Doug's MATLAB Video Tutorials

August 6th, 2009

GUI tutorials from the File Exchange

I was once one of the many people that have been a steward of the Pick Of The Week blog. I try not to highlight File Exchange files here, but this exceptional tutorial is, well, an exception. Matt wrote a series of small, single purpose GUIs that show a simple skill. Take a look at the list of questions that he solves:

1. How do I manipulate the strings in a uicontrol?

2. How do make a uicontrol invisible/visible?

3. How do I make a multi-line editbox?

4. How can I let the user of my GUI know his actions are futile (or producing no results)?

5. How can I tell which uicontrol is selected?

6. How can I tell how many times a uicontrol has been activated?

7. How do I tell which button in a buttongroup is selected?

8. How do I let the user know a process is running in the background?

9. How do I control the mouse pointer with a GUI?

10. How can I access the value (current position) of a slider?

11. How can I use different colored strings in a listbox?

12. How can I make text that can be copied but not changed?

13. How do I allow the user of my GUI to set the range of a slider?

14. How do I use the buttondownfcn on an axes object?

15. How do I make a callback talk to another callback?

16. How can I get the string from a popup or listbox?

17. How can I set the string in a popup or listbox?

18. How can I add to the string in a popup or listbox?

19. How do I tell which figure was current before my callback executed?

20. How do I get data from another GUI?

21. How do I make a GUI to open image files only?

22. How can I make popup choices mutually exclusive?

23. How can I show the current pointer location in axes coordinates?

24. How can I use uicontextmenus?

25. How do I make my GUI control an axes in another figure?

26. What are callback strings?

27. How can I make it so that when one of the figures closes, they all close?

28. How do I make several uicontrols interact in a more complicated GUI?

29. How do I get data from a GUI to the base workspace?

30. How do I make toggle buttons act like tabbed-panels?

31. How can I make a password editbox that has the ***** symbols?

32. How can I use nested function as callbacks?

33. How can I use uiwait in a GUI?

I found it best to print out the two page PDF with questions and then run the GUIs I wanted. Download the bundle here.

6 Responses to “GUI tutorials from the File Exchange”

  1. matt fig replied on :

    Hello Doug,

    Thanks for the compliment. It looks like you have an older version of the collection, judging from the questions list. I have since added a few more advanced GUIs, corrected a couple of typos, and added more suggested exercises.

    One of the great things about the ML community is the productive interaction between members. Several of the suggested exercises and even GUI ideas came from users who used my files and wanted to help make them better. I appreciate this and look forward to receiving more ideas for improvement in any of these areas.

    Matt Fig

  2. dhull replied on :

    Matt,

    It is good to see that you are the steward of an ever improving set of GUI examples. I will leave the blog post as is, there should be enough keywords that the right people will find it.

    I know what you mean about getting good questions and using those to improve your examples. After 160 videos and about 100 twitter examples I am running our of ideas, and so I need questions from people! :)

    Thanks,
    Doug

  3. watzabatza replied on :

    Good Day!

    Thanks for the post.. Tutorials really help me.

  4. Madhu replied on :

    It’s one of the best gui tutorials I came across.
    Many thanks to Matt. Those examples dratically increased my learning skills. I strongly recommend this material to all Matlab gui beginners.

  5. Emil replied on :

    Hei,

    I am having problems using Greek characters a uimenu’s label.
    Is there any way to do this? My idea was

    uimenu(h,'label',text('str','reset to default (\mu = 1.2 & \sigma = 1.5)'))
    

    as uimenu has no interpreter property. Any other suggestions?

    Thanks a lot, Emil

  6. dhull replied on :

    @Emil,

    Sorry, there is not a real good solution for this. Maybe you could leave it blank and place an annotation that does support TeX there.

    Doug

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


MathWorks

Doug Hull is a proud MathWorker who is on a mission to help you with MATLAB.

Doug's picture

These postings are the author's and don't necessarily represent the opinions of The MathWorks.