Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
Divyesh pandav
Divyesh pandav am 29 Sep. 2021
Kommentiert: Divyesh pandav am 1 Okt. 2021
code:
run 'C:\Users\user's PC\Desktop\test.m'
Error: Character vector is not terminated properly.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 30 Sep. 2021
run("C:\Users\user's PC\Desktop\test.m")
(tested)

Weitere Antworten (2)

Image Analyst
Image Analyst am 29 Sep. 2021
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 Kommentare
Divyesh pandav
Divyesh pandav am 29 Sep. 2021
>> 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 am 29 Sep. 2021
@Image Analyst sir my pc name is (user's PC) i want to use in run function.. but its slowing error..!!

Melden Sie sich an, um zu kommentieren.


Image Analyst
Image Analyst am 29 Sep. 2021
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.

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by