フォルダ名の取得について
93 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
takeru misawa
am 10 Sep. 2021
Kommentiert: takeru misawa
am 13 Sep. 2021
uigetdirで/home/name/Desktop/ANALYSIS/result/IntegratedFilesというパスを取得した際に、IntegratedFilesの文字列をAという変数に入れたい時どうすればよいでしょうか。またその解決方法はwindows,mac,linaxどのOSで実行しても実行できる方法である方が嬉しいです。
0 Kommentare
Akzeptierte Antwort
Hernia Baby
am 10 Sep. 2021
str = strsplit('/home/name/Desktop/ANALYSIS/result/IntegratedFiles','/')
A = str{end}
Weitere Antworten (1)
Atsushi Ueno
am 10 Sep. 2021
Bearbeitet: Atsushi Ueno
am 10 Sep. 2021
fileparts関数を使います。windows,mac,linuxどのOSで実行しても実行できる方法です。
% selpath = uigetdir % ここでは実行出来ないので省略
selpath = '/home/name/Desktop/ANALYSIS/result/IntegratedFiles.txt';
[filepath,A,ext] = fileparts(selpath)
1 Kommentar
Siehe auch
Kategorien
Mehr zu Geology 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!