Change default IDE layout

3 views (last 30 days)
James Johnson
James Johnson on 10 Feb 2016
Commented: James Johnson on 20 Oct 2020
I have saved a custom layout (on the environment tab) which works much better for my multi-screen set up. Unfortunately I have to manually tell Matlab R2015b to load that custom layout every time it starts up. This is tedious and in previous versions (R2011b) I was able to change this so that it loaded my custom layout every time. How do I do this in Matlab R2015b?
Can one set a custom layout as default? Alternatively, is there a setting which will cause Matlab to load the most recently used layout every time?

Accepted Answer

sam0037
sam0037 on 15 Feb 2016
Hi James,
The most recently used layout is generally loaded in MATLAB R2015b too. I have tried the same successfully. You can try one of the following to load a recently used or custom layout:
  • The layout is loaded from the preference settings of MATLAB. You can create a new preference settings and then create and save the custom layout. Click here to know more about creating a new preference settings.
Try the below workaround if the above doesn't help.
  • You can load the desired layout programatically whenever the MATLAB starts using the STARTUP.M file which is explained here.
The following 3 commands can be used together to change MATLAB desktop layout. However, using these commands are risky and one might override default MATLAB parameters. This may corrupt the MATLAB environment. The commands are provided as follows:
1. The following command is used to obtain the desktop object using Java:
>> desktop = com.mathworks.mde.desk.MLDesktop.getInstance;
2. This command saves the current layout:
>> desktop.saveLayout( 'save_layout_name' );
where save_layout_name is the name of the current layout to be saved. Once saved, the custom layout can be viewed or deleted through the 'Layout' button on the MATLAB desktop.
3. The command to load (or restore) a layout is as given:
>> desktop.restoreLayout( 'load_layout_name')
where load_layout_name is the name of the custom layout that you want to load.
Regards,
Shamim
  1 Comment
James Johnson
James Johnson on 20 Oct 2020
When I upgraded to the next MATLAB the issue went away and it correctly loaded the last layout. Previously it was not loading the last layout.

Sign in to comment.

More Answers (0)

Categories

Find more on Desktop in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!