An open exchange for the MATLAB and Simulink user community |
Hosted by The MathWorks |
|
| Related Topics |
| New Products | Support | Documentation | Training | Webinars | Jobs | Newsletters |
| Problems? Suggestions? Contact us at files@mathworks.com | © 1994-2008 The MathWorks, Inc. Trademarks Privacy Policy |
Hello,
Thanks for the video.
Okay building on this example, how would one create a program that does this:
When the push button is pressed, a box opens up which allows one to enter some string into a text box and this string is then displayed in the static text box of the original figure?
Thanks,
–zia
Zia,
To do something like this, look at the “modal question dialog” template that you can choose when you start Guide. This GUI will return a value when it is closed using this command:
“handles.output = get(hObject,’String’);”
Once you have that output (by saying something like “str = modalUI”) then you can use that string to populate a static text box as shown in my original video.
I hope this is useful. Let me know!
Doug
Mini Videos are very good.
Thank you
Keep it up
Now all we have to do is get Loren on video as well!!
John-
What topic(s) would you like to hear about?
–Loren
Hi,
I’d like to ask if this could be done but writing out to a uicontrol edit text box. I’ve tried to implement a button to change the content of the edit text but with no results…
Thanks!
ps. i’m not using Guide
Allan,
You should be able to do this by seting the String property of the edit box:
set(handles.edit1, ’string’, ‘foo’)
Doug
Hi Doug,
Thanks for the tip but I can’t get it to work, although your suggestion is the correct procedure.
Could it be a panel issue? (the push button it is linked to a panel handle).
I think I’m missing something…
Any help would be much appreciated.
Regards,
Allan
UPDATE:
Issue solved. I just fixed some handles mismatches…
Thanks!
How can I download your vedio?
Michael,
I just added a link to the video on the File Exchange right under the video.
Doug