実行しているファイルのパスの取得に関して
27 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Teppei Iwata
am 4 Jul. 2020
Kommentiert: Teppei Iwata
am 7 Jul. 2020
MATLABでmlxやmファイルを実行する際,そのファイルがあるディレクトリの場所に移動してから実行しようと考えております.
ディレクトリの移動には,
cd(PATH)
を使用すればよいことは分かるのですが,mlxやmファイルが存在する場所をどのように確認すればよいでしょうか?
また,cdコマンドは実行するmlxファイルやmファイルに記述することを考えております.
1 Kommentar
madhan ravi
am 4 Jul. 2020
Google translate:
When executing mlx or m file in MATLAB, I am thinking of moving to the location of the directory where the file is located before executing it.
To move the directory,
cd (PATH)
I know I should use, but how do I find out where the mlx or m files are?
Also, we are planning to write the cd command in the mlx file or m file to be executed.
Akzeptierte Antwort
Weitere Antworten (1)
Toshinobu Shintai
am 4 Jul. 2020
"which"というコマンドを使うと、そのファイルの場所を調べることが出来ます。
例:
>> which vdp
C:\Program Files\MATLAB\R2020a\toolbox\simulink\simdemos\simgeneral\vdp.slx
Siehe auch
Kategorien
Mehr zu ファイルの操作 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!