Matlab online problems - doesn't use startup.m, ignores setpath, forgets preferences

4 views (last 30 days)
online has mutliple problems. I'll be glad if anyone has solutions
doesn't run startup.m from intial location
unlike desktop, preferences > general does not have a option to set startup folder
using setpath or pathtool is ignored. it has old bad paths(mine) and forgets new paths added
forgets prefs changes after quit
  4 Comments
Les Beckham
Les Beckham on 7 Nov 2023
Moved: Cris LaPierre on 7 Nov 2023
The command to save the search path is savepath (all one word). save path (two words) will save your workspace variables to a file called path.mat.
WTxnitz
WTxnitz on 7 Nov 2023
I should have been clearer: I meant - hit the button in the upper right corner, with the tooltip "save path for future"
which is what I hit after making edits.
deleting old bad paths
adding new paths
changing order
hit the button in the upper right corner, with the tooltip "save path for future"
I assume the callback includes savepath.
it's the new (correct) version
Immediately check - new version
check later in same session - new version
logout/in - back to old version; no new path, bad old paths; edits gone
desktop versions, neither Mac nor PC, do not do this. They operate as expected.
It is a problem with matlab online. Whether accessed by Mac or PC - same issue

Sign in to comment.

Accepted Answer

Sanchari
Sanchari on 16 Nov 2023
Edited: Sanchari on 16 Nov 2023
Hello WTxnitz,
I understand that you want to utilize the "startup.m" file in MATLAB Online and save changes to the "setpath" and "preferences" for future sessions in MATLAB Online.
To achieve this, you can follow these steps:
  1. Verify MATLAB version: Check the version of MATLAB Online by typing "ver" in the command window. Ensure that you are using the latest version as the "setpath" and "preferences" options are fully functional in this version.
  2. Unlike the desktop version, MATLAB Online does not provide an option to set the initial working folder. Create a startup folder with the startup file within it. Then, click on "Set Path" in the Environment section and select the path to the startup folder.
  3. Finally, click on the "Save Path for future sessions" button located in the top-right corner of the window.
By setting and saving the startup folder for future sessions, you should be able to run the "startup.m" file from the command window. Ensure that your current working directory is the one containing the "startup.m" file. You can also right-click on the current folder and select "Add to path > Selected folders and subfolders".
For more information on setting the startup folder locally, you can refer to the MathWorks documentation: https://www.mathworks.com/help/matlab/matlab_env/matlab-startup-folder.html
Additionally, you can find helpful information on MATLAB Answers:
3. “Setup Search Path in MATLAB Online”
I hope this information is helpful to you!

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!