GUI help in calling an if elseif else function

1 visualización (últimos 30 días)
Aser Zidan
Aser Zidan el 16 de Jul. de 2019
Comentada: Walter Roberson el 16 de Jul. de 2019
Hi all,
I am trying to call out this if elseif else function in the GUI. So basically, the "what case box" represent the casenum, and the empty static box should call out a msg when "what case box" has a value.

Respuestas (1)

Walter Roberson
Walter Roberson el 16 de Jul. de 2019
Use the Callback property of the edit box to trigger the action. Remember that the edit box will be char (or cell array of char if Max>1 for the edit box) so you will need to str2double.
Note: you should not have any condition on the "else".
  4 comentarios
Aser Zidan
Aser Zidan el 16 de Jul. de 2019
hi,
Actually when try to run it now, this code pops up:
Undefined function or variable 'gui_mainfcn'.
Error in demo2 (line 42)
gui_mainfcn(gui_State, varargin{:});
Walter Roberson
Walter Roberson el 16 de Jul. de 2019
What is the result you expect from
str2double(set(handles.output, 'string'))
? Notice that is a set() call, not a get() call.

Iniciar sesión para comentar.

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by