If not with a xlsx file

1 回表示 (過去 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 Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by