Character string error only in no desktop mode

조회 수: 2 (최근 30일)
Louis Davis
Louis Davis 2022년 4월 22일
답변: Steven Lord 2022년 10월 28일
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
Walter Roberson
Walter Roberson 2022년 4월 22일
I think I am out of ideas :(
Louis Davis
Louis Davis 2022년 4월 23일
That's OK, thanks for your suggestions

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

답변 (2개)

Shanmuganathan
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

Steven Lord
Steven Lord 2022년 10월 28일
Do the commands appear to have extra line breaks inserted into them? If so see this Answers post.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by