how get value from edit textbox gui matlab
26 views (last 30 days)
Show older comments
hello,
How can i get value from another edit textbox and use this value again to perform some calculation.
For example, this value is obtain from the graph
set(handles.kp,'String',num2str(sysP1D.Kp));
i want to use this value to perform another calculation.
0 Comments
Answers (1)
DGM
on 8 Apr 2021
If you know what editbox you're looking for in your handles object, you can just get its contents
myvariable=get(handles.myeditbox,'String');
If you you need numeric output, obviously use str2num() on it.
2 Comments
DGM
on 8 Apr 2021
Oh, you're trying to set simulink block parameters? I don't see that there's any obvious problem with the code you've shown, but I imagine that's not the entire story. If you've verified that the values you are getting from your edit box are being recieved and stored correctly in the intended variables, then I'd suggest you make a new question that specifically addresses the issue of getting simulink block parameters to update after being set programmatically.
It's been nearly 10 years since I did this sort of thing with simulink, and I imagine many things, including recommended practices, have changed.
See Also
Categories
Find more on Simulink Functions 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!