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
Show older comments
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 Comments
Walter Roberson
on 28 Aug 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
on 29 Aug 2013
Accepted Answer
More Answers (1)
ES
on 29 Aug 2013
0 votes
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 Comment
Image Analyst
on 29 Aug 2013
I think the values are being changed by the user in Excel, not being changed in MATLAB.
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!