Check empty & not empty of text box in GUI

5 vues (au cours des 30 derniers jours)
RJS
RJS le 9 Déc 2021
Réponse apportée : Voss le 9 Déc 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{:});

Réponse acceptée

Voss
Voss le 9 Déc 2021
replace empty with isempty

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by