dropdown list cancel option

3 ビュー (過去 30 日間)
Muazma Ali
Muazma Ali 2021 年 12 月 26 日
回答済み: Simon Chan 2021 年 12 月 26 日
Hi
I have this code:
S={'NH4Cl'; 'MgCl2'; 'CaCl2'; 'KCl'; 'ZnSO4'; 'NaCl'; 'ZnBr2'; 'CH3CO2K';'HCOOK';' HCOONa'; 'CaBr2'};
str={'Choose the salts available'};
result=listdlg('Promptstring',str, 'ListSize', [100,100], 'ListString', S, 'SelectionMode', 'multiple');
% And I want to set up a disp sentence correponding to that user action where the user has pushed the buttton for cancel.
I tried with if result==[ ] but it didnt work.

回答 (1 件)

Simon Chan
Simon Chan 2021 年 12 月 26 日
Try function isempty:
if isempty(result)
disp('User select to cancel');
end

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by