What is the difference between the userpath and the startup folder?
2 views (last 30 days)
MarKf on 5 Aug 2023
Edited: MarKf on 5 Aug 2023
They are different. Matlab starts in the startup folder, the initial working folder, it's displayed on the "Current Folder" panel, in the Toolbar and with the command pwd right after Matlab starts, before you or a script optionally change it with cd. You can set it also in your personal startup script you can put in userpath. It is suggested that you set your startup folder as your userpath (in the link above it even lists the advantages) but it's not a requirement. Also, if you open a file with Matlab (like an .m file which you doubleclick on it and you have Matlab set to open it) then it will start in the folder the file is in, for convenience, then it's likely to be different anyway. Otherwise Matlab starts in the startup folder (I like the preference "Last working folder from previous session") when you just open it from the Matlab icon. They are both in your search path automatically.