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

1 次查看(过去 30 天)
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
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 个评论
Divyesh pandav
Divyesh pandav 2021-9-29
>> 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.
Divyesh pandav
Divyesh pandav 2021-9-29
@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
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.

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by