Modifying startupsav.m/startup.m file to change new plot figure location not working

조회 수: 3 (최근 30일)
When a new plot figure opens, it does so off screen. I modified the startupsav.m file by adding the line 'set(0, 'DefaultFigurePosition', [ x, y, z, h]); and changing the name to startup.m, as per the comment in the file. The only other line in the file is 'load matlab.mat', which gets executed because the workspace gets reloaded. Also, when Matlab starts, it opens across two screens. It would be nice to fix both these issues.

채택된 답변

Nivedita
Nivedita 2023년 9월 4일
편집: Nivedita 2023년 9월 8일
Hi Dan!
I understand that you are facing issues with the following:
  1. Every new plot figure is opening off screen.
  2. The MATLAB window is opening across two screens.
To address your first issue, you can follow these steps:
  1. After modifying the “startupsav.m” file, make sure that you are saving it as “startup.m” in the appropriate MATLAB startup folder. This can be found by running the following command in MATLAB:
userpath
2. Right-click the icon for MATLAB on the desktop and select “Properties” from the context menu. The “Properties” dialog box for MATLAB opens in the Shortcut pane by default.
3. Paste the path where you have saved the “startup.m” file against the “Start in” field.
4. Restart MATLAB for the changes to take effect.
The second issue is likely due to a configuration issue with the display settings or MATLAB's display preferences. You can try the following steps to resolve this issue:
  1. Open MATLAB.
  2. Go to the "Home" tab in the MATLAB desktop.
  3. In the "Environment" section, click on "Layout" and select "Default Layout".
This should reset MATLAB's layout to a single screen. If that doesn't work:
  1. In the “Environment” section, go to "Preferences" > "MATLAB" > "Desktop" and check your "Desktop Layout" settings. Make sure it's set to "Default Layout”.
  2. Restart MATLAB to see if the issue is resolved.
If the problem persists, you may need to adjust your machine’s display settings or check if there are any third-party software conflicts that might be affecting MATLAB's window management.
I hope this helps!
Regards,
Nivedita.
  댓글 수: 1
Dan
Dan 2023년 9월 6일
Thank you for the suggestions. I fixed the plot problem a while back but the second issue remains. i learned to live with it since it does not affect functionality. I think its my window manager since other applications also perform this way.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by