Creating Shortcut for Matlab app (mlapp)
16 views (last 30 days)
Show older comments
Is there a way to create a desktop shortcut to run a GUI created with the Matlab App designer (.mlapp file)?
0 Comments
Accepted Answer
Eric Delgado
on 19 Sep 2022
No. You have to compile it. And then, during the installation process of your app, you could choose to create a desktop shortcut for your app.
More Answers (1)
jon
on 15 Oct 2024
Edited: jon
on 15 Oct 2024
Yes, It is possible. Lets assume you have a matlab app called MyApp.
Open notepad, write the following, then save as a .bat file. Make a desktop shortcut to your bat file (or just put the bat file on the desktop i guess)
:: echo off will stop the window temrinal from showing up
@echo off
:: if matlab already open then kill it
TASKLIST | FINDSTR MATLAB && TASKKILL /IM MATLAB.exe /F
:: then open the script, minimise the main page, dont show the splash screen, and i forgot what the -r option means
matlab -minimize -nosplash -r "MyApp"
To take this one step further, I downloaded SplashScreen from FEX (https://uk.mathworks.com/matlabcentral/fileexchange/30508-splashscreen), and wrote a matlab script which opens a splash screen then starts the app. In this case I change the BAT file to open this matlab script instead of opening the app directly.
s = SplashScreen('Starting LAPS','laps_sicm_logo.png'); % show my custom splash screen
MyApp; % start MyApp
s.Visible = 'off'; % i dont remember why i turn this off then on, maybe it brings the window to the front?
s.Visible = 'on';
delete(s); % remove the splash screen once the app has started
Therefore, in this more complicated scenario, the BAT file will:
1- check if matlab is already open, and if so it will close it to avoid multiple instances
2- open Matlab with the main window minimised
3- show a custom splash screen
4- open my desired app
0 Comments
See Also
Categories
Find more on Downloads in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!