フォルダ名の取得について
Mostra commenti meno recenti
uigetdirで/home/name/Desktop/ANALYSIS/result/IntegratedFilesというパスを取得した際に、IntegratedFilesの文字列をAという変数に入れたい時どうすればよいでしょうか。またその解決方法はwindows,mac,linaxどのOSで実行しても実行できる方法である方が嬉しいです。
Risposta accettata
Più risposte (1)
Atsushi Ueno
il 10 Set 2021
Modificato: Atsushi Ueno
il 10 Set 2021
fileparts関数を使います。windows,mac,linuxどのOSで実行しても実行できる方法です。
% selpath = uigetdir % ここでは実行出来ないので省略
selpath = '/home/name/Desktop/ANALYSIS/result/IntegratedFiles.txt';
[filepath,A,ext] = fileparts(selpath)
1 Commento
takeru misawa
il 13 Set 2021
Modificato: takeru misawa
il 13 Set 2021
Categorie
Scopri di più su ファイルの操作 in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!