フォルダ名の取得について
62 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
takeru misawa
il 10 Set 2021
Commentato: takeru misawa
il 13 Set 2021
uigetdirで/home/name/Desktop/ANALYSIS/result/IntegratedFilesというパスを取得した際に、IntegratedFilesの文字列をAという変数に入れたい時どうすればよいでしょうか。またその解決方法はwindows,mac,linaxどのOSで実行しても実行できる方法である方が嬉しいです。
0 Commenti
Risposta accettata
Hernia Baby
il 10 Set 2021
str = strsplit('/home/name/Desktop/ANALYSIS/result/IntegratedFiles','/')
A = str{end}
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
Vedere anche
Categorie
Scopri di più su Geology in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!