How to remove file extension when using ugetfile in app designer?

202 ビュー (過去 30 日間)
farzad
farzad 2020 年 11 月 18 日
回答済み: Rik 2020 年 11 月 18 日
Hi All
I use
[filename,pathname] = uigetfile('*.xlsx');% add ur extension post period within parathesis.
fullfilename = fullfile(pathname,filename);
A = xlsread(fullfilename); % if it is a excel file. else use whatever it is.
but then I need to use the filename but without its extension, how do I do that in app designer

採用された回答

Rik
Rik 2020 年 11 月 18 日
The easiest way to remove an extension is with fileparts:
[p,f,e]=fileparts(fullfilename);
fullfilename=fullfile(p,f);

その他の回答 (0 件)

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by