開いているスクリプトのあるフォルダのパスを得る方法
Mostra commenti meno recenti
whichを用いることでそのスクリプトの名前を引数開いているスクリプトのパスを取得できますが,そのスクリプト名がパスに含まれます.
そのスクリプト名を含まない,そのフォルダまでのパスを取得する方法はありますか?
たとえばC:\Users\name\matlab\script.mlxに関して,script.mlxがあるフォルダのパス
C:\Users\name\matlab\を取得する方法が知りたいです.
Risposta accettata
Più risposte (1)
Kenta
il 14 Mag 2020
こんにちは、extractBefore関数を使うのはいかがでしょうか?以下のようにすればできると思います
path=which(script_name);
extractBefore(script_name)
Categorie
Scopri di più su Communications Toolbox in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!