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

조회 수: 199 (최근 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개)

카테고리

Help CenterFile Exchange에서 Package and Share Apps에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by