Creating Shortcut for Matlab app (mlapp)
17 次查看(过去 30 天)
显示 更早的评论
Is there a way to create a desktop shortcut to run a GUI created with the Matlab App designer (.mlapp file)?
0 个评论
采纳的回答
Eric Delgado
2022-9-19
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.
更多回答(1 个)
jon
2024-10-15
编辑:jon
2024-10-15
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!