If not with a xlsx file

조회 수: 5 (최근 30일)
Daniel
Daniel 2022년 9월 28일
편집: Rik 2022년 9월 28일
Hi, I have a IF with a not equal for my xlsx file, right now im using a empty string and works perfect, but I want to change that empty string to something like "*xlsx".

채택된 답변

Rik
Rik 2022년 9월 28일
편집: Rik 2022년 9월 28일
You should have used isempty in your current code:
if ~isempty(app.filename)
For the test you now want to do, you should extract the extension with the fileparts function and use strcmp:
[~,~,ext]=fileparts(app.filename);
if strcmp(ext,'.xlsx')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by