In the Environment seciton of the desktop's Home Tab, there is an area for saving and loading one's preferred desktop layouts:
What I'd like to know is, once you've created and saved a desktop layout, is there a way to launch it programmatically?

 採用された回答

TED MOSBY
TED MOSBY 2025 年 5 月 13 日

2 投票

Hi Matt,
As I understand from your question, you want to launch a saved desktop layout programmatically. For that you can run the commands shown below in MATLAB command window:
desktop = com.mathworks.mde.desk.MLDesktop.getInstance;
desktop.restoreLayout('fav');
Here "fav" is the name of the layout you had saved. Please note the commands are case senstitive.
Hope this helps!

4 件のコメント

Matt J
Matt J 2025 年 5 月 13 日
編集済み: Matt J 2025 年 5 月 13 日
Excellent! Many thanks.
Matt J
Matt J 2025 年 5 月 13 日
It works well, but in the Editor it shows a Code Analyzer warning:
Do you know what may eventually replace it, or if there is any more time-proof method?
TED MOSBY
TED MOSBY 2025 年 5 月 13 日
編集済み: TED MOSBY 2025 年 5 月 13 日

It doesn't show such warning in my editor though but let me see some other workaround

TED MOSBY
TED MOSBY 2025 年 5 月 17 日
Couldnt find any other workaround, but you can use this for the time being!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Get Started with MATLAB についてさらに検索

製品

リリース

R2024b

タグ

質問済み:

2025 年 5 月 12 日

コメント済み:

2025 年 5 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by