Check empty & not empty of text box in GUI

5 visualizzazioni (ultimi 30 giorni)
RJS
RJS il 9 Dic 2021
Risposto: Voss il 9 Dic 2021
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{:});

Risposta accettata

Voss
Voss il 9 Dic 2021
replace empty with isempty

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by