Check empty & not empty of text box in GUI

5 ビュー (過去 30 日間)
RJS
RJS 2021 年 12 月 9 日
回答済み: Voss 2021 年 12 月 9 日
Notchop and Compop are the output textbox of GUI
op_n = str2double(get(handles.Notchop, 'String'));
op_c = str2double(get(handles.Compop, 'String'));
if ~empty(op_n)&& isempty(op_c) %op_n is not empty and op_c is empty
disp('H')
elseif isempty(op_n) && ~empty(op_c) %op_n is empty and op_c is not empty
disp('Gc')
elseif ~empty(op_n) && ~empty(op_c) %op_n is not empty and op_c is not empty
disp('H *Gc')
end
it showing error
Undefined function 'empty' for input arguments of type 'double'.
Error in GUI3_4>step_Callback (line 417)
if ~empty(op_n)&& isempty(op_c)
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in GUI3_4 (line 42)
gui_mainfcn(gui_State, varargin{:});

採用された回答

Voss
Voss 2021 年 12 月 9 日
replace empty with isempty

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by