How to open a 'Matlab App' desktop shortcut with Matlab minimize. I want to see only my App without Matlab behind.

13 views (last 30 days)
Suppose I have a Matlab app J:\Test.mlapp
I have create a desktop shortcut with windows 11 the usual way, right clic, more options, send to desktop (create shortcut).
It works but I'd like to see only my app not the Matlab environment behind it, is it possible ?
I don't want to compile it.
  2 Comments
Matt J
Matt J on 30 Aug 2025
Note that if Matlab is already running (and the desktop minimized), then launching the app will not cause the desktop to un-minimize.
Pierre
Pierre on 30 Aug 2025
I saw that while testing my shortcut but not the solution I was looking for. It's just annoying a littler bit.

Sign in to comment.

Accepted Answer

Pierre
Pierre on 30 Aug 2025
Ok I found it, thanks to ChatGPT.
We only need to add this to the StartupFcn(app). Place it at the beginning of the function it will be quicker.
% --- Executes after component creation
function StartupFcn(app)
% Try to minimize the MATLAB desktop when app starts
try
desktop = com.mathworks.mde.desk.MLDesktop.getInstance;
desktopMainFrame = desktop.getMainFrame;
desktopMainFrame.setExtendedState(java.awt.Frame.ICONIFIED); % Minimize MATLAB
catch ME
warning('Could not minimize MATLAB desktop: %s', ME.message);
end
end

More Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!