Creating Shortcut for Matlab app (mlapp)
조회 수: 18 (최근 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
참고 항목
카테고리
Help Center 및 File Exchange에서 Downloads에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!