Character string error only in no desktop mode
2 次查看(过去 30 天)
显示 更早的评论
I am learning how to run MATLAB (I have 2022a) without a GUI.
Currently I'm trying to add a path on no desktop mode.
I'm opening MATLAB using the command prompt via
matlab -nodesktop
and using
userpath("C:\Users\LouisDavis\Documents\MATH\Masters 2022&23\Thesis\Matlab code")
This runs correctly when I open matlab with a GUI
I'm getting the error "Error: String is not terminated properly" on no desktop mode. And if I replace the above with
userpath('C:\Users\LouisDavis\Documents\MATH\Masters 2022&23\Thesis\Matlab code')
The error becomes "Error: Character vector is not terminated properly."
Any help would be much appreciated.
6 个评论
回答(2 个)
Shanmuganathan
2022-10-28
Hi Louis,
I understand you are facing an issue with adding user paths in MATLAB "nodesktop" mode.
I tried adding a similar folder structure to my user path and it seems to be working fine in MATLAB with "-nodesktop" flag.
The folder specified using userpath appears on the search path immediately, and at startup in future sessions. Hence, you can add the user path from regular MATLAB and use it in MATLAB with "-nodesktop" flag.
Regards,
Shanmuganathan
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!