Creating Shortcut for Matlab app (mlapp)

17 Ansichten (letzte 30 Tage)
John Murphy
John Murphy am 8 Mär. 2022
Bearbeitet: jon am 15 Okt. 2024
Is there a way to create a desktop shortcut to run a GUI created with the Matlab App designer (.mlapp file)?

Akzeptierte Antwort

Eric Delgado
Eric Delgado am 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.

Weitere Antworten (1)

jon
jon am 15 Okt. 2024
Bearbeitet: jon am 15 Okt. 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

Kategorien

Mehr zu Downloads finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by