Hello, I'm looking to have a static text or edit text box change it's value depending on what I put in for the other edit text boxes in a GUI
Mostrar comentarios más antiguos
Hello, I don't want to have to press a button to get the value in a static or edit text box to change. I want the value to change as I change other values (like excel) with out a push-button in my GUI. I got it to work for a brief moment by placing the code under the function
SIMPLE_FO_GUI_OpeningFcn(hObject, eventdata, handles, varargin)
while(1)
pause(1)
F_SW_in_i_max = str2double(get(handles.F_SW_in_max,'string'));
DSin_i_max = str2double(get(handles.DSin_i_max,'string'));
SWin_i_max = str2double(get(handles.SWin_i_max,'string'));
Water_recov = str2double(get(handles.Percent_water_recov,'string'));
min_draw = # (some value);
set(handles.Min_Draw_flow, 'string', num2str(min_draw)); end
2 comentarios
Walter Roberson
el 28 de Ag. de 2013
What mechanism are you using to change the variables? Are they being changed in a gui? Do you need the change to take effect every time some variable is modified in the code, without the code needing to have to specifically give notification to look for a new value?
Alex
el 29 de Ag. de 2013
Respuesta aceptada
Más respuestas (1)
ES
el 29 de Ag. de 2013
0 votos
You can do a Get the value from the first Text Box every time it is edited by using edit Call Back function using
RecievedString=get(handles.Box1, 'String')
Update your Text Box 2 immediately. set(handles.Box2, 'String', RecievedString)
1 comentario
Image Analyst
el 29 de Ag. de 2013
I think the values are being changed by the user in Excel, not being changed in MATLAB.
Categorías
Más información sobre Spreadsheets en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!