my pc name is (user's pc) how to pass in run function ?

code:
run 'C:\Users\user's PC\Desktop\test.m'
Error: Character vector is not terminated properly.

 채택된 답변

Walter Roberson
Walter Roberson 2021년 9월 30일
run("C:\Users\user's PC\Desktop\test.m")
(tested)

추가 답변 (2개)

Image Analyst
Image Analyst 2021년 9월 29일

0 개 추천

That's too many apostrophes (three). The string ends at the second one.
If you need an apostrophe in the path, use double quotes "
"C:\Users\user's PC\Desktop\test.m"

댓글 수: 2

>> run "C:\Users\user's PC\Desktop\test.m"
run "C:\Users\user's PC\Desktop\test.m"
Error: Character vector is not terminated properly.
@Image Analyst sir my pc name is (user's PC) i want to use in run function.. but its slowing error..!!

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

Image Analyst
Image Analyst 2021년 9월 29일

0 개 추천

If you want to run the m file, set the Current folder to the folder where the text.m lives and do
>> test
No need to type "run" before it.
Or double click on it in the Current folder panel to bring it up in a text editor, and click the green Run triangle on the Tool ribbon.

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

질문:

2021년 9월 29일

댓글:

2021년 10월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by