how get value from edit textbox gui matlab
48 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
DGM
le 8 Avr 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 commentaires
DGM
le 8 Avr 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.
Voir également
Catégories
En savoir plus sur Simulink Functions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!