フォルダ名の取得について
Show older comments
uigetdirで/home/name/Desktop/ANALYSIS/result/IntegratedFilesというパスを取得した際に、IntegratedFilesの文字列をAという変数に入れたい時どうすればよいでしょうか。またその解決方法はwindows,mac,linaxどのOSで実行しても実行できる方法である方が嬉しいです。
Accepted Answer
More Answers (1)
Atsushi Ueno
on 10 Sep 2021
Edited: Atsushi Ueno
on 10 Sep 2021
fileparts関数を使います。windows,mac,linuxどのOSで実行しても実行できる方法です。
% selpath = uigetdir % ここでは実行出来ないので省略
selpath = '/home/name/Desktop/ANALYSIS/result/IntegratedFiles.txt';
[filepath,A,ext] = fileparts(selpath)
1 Comment
takeru misawa
on 13 Sep 2021
Edited: takeru misawa
on 13 Sep 2021
Categories
Find more on ファイルの操作 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!