フォルダ名の取得について
显示 更早的评论
uigetdirで/home/name/Desktop/ANALYSIS/result/IntegratedFilesというパスを取得した際に、IntegratedFilesの文字列をAという変数に入れたい時どうすればよいでしょうか。またその解決方法はwindows,mac,linaxどのOSで実行しても実行できる方法である方が嬉しいです。
采纳的回答
更多回答(1 个)
fileparts関数を使います。windows,mac,linuxどのOSで実行しても実行できる方法です。
% selpath = uigetdir % ここでは実行出来ないので省略
selpath = '/home/name/Desktop/ANALYSIS/result/IntegratedFiles.txt';
[filepath,A,ext] = fileparts(selpath)
类别
在 帮助中心 和 File Exchange 中查找有关 ファイルの操作 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!