フィルターのクリア

how to get string for empty Edit Text in Matlab GUI ?

1 回表示 (過去 30 日間)
MatlabFan
MatlabFan 2013 年 4 月 6 日
Hi,
I inserted an Edit Text in a Matlab GUI, and I would like to perform some actions when nothing is in the Edit Text (Edit Text empty). I have the following:
extractPass=get(handles.inputPassword_txt,'string');
The problem is that, when the Edit Text is empty, isempty(extractPass)= 0. I was expecting isempty(extractPass)=1 when the Edit Text is empty.
What do I need to write to know when the Edit Text is empty ?
Thanks.

採用された回答

per isakson
per isakson 2013 年 4 月 6 日
With R2012a I fail to reproduce your problem. Try
class( extractPass )
double( extractPass )
to find out what get returns
  7 件のコメント
MatlabFan
MatlabFan 2013 年 4 月 7 日
Thank you very much for your help Isakon. I appreciate that. It still doesn't solve the problem though.
per isakson
per isakson 2013 年 4 月 7 日
編集済み: per isakson 2013 年 4 月 7 日
You have a < 2x1 cell> array of strings (or something else). Try this
extractPass{1}
extractPass{2}
whos extractPass
for ii = 1 : numel( extractPass )
class( extractPass{ii} )
isempty( extractPass{ii} )
end
or use the variable editor to find out what is in the cells.
Do you have a squeezed scroll bar to the right end of the edit box?
If nothing helps restart Matlab!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by