How to Build a Simple Graphical User Interface in MATLAB

Open the Matlab Program and wait for it to finish loading; , Click on "MATLAB" in the launch pad to expand the list and then double click on "GUIDE (GUI Builder)"., Click on the "ok" button in the left hand side of the window., Move the mouse to...

15 Steps 1 min read Advanced

Step-by-Step Guide

  1. Step 1: Open the Matlab Program and wait for it to finish loading;

    If you cannot see the launch pad, click on view followed by launch pad.

    The GUI builder will appear , This will allow you to drag and drop a pushbutton. ,,,, A property manager will pop up , Also Change the Tag to "button"

    , This will also pop up the code for your program. , This is the callback function.

    Any code below this will be executed whenever the user pushes the button.

    Here we will make this change the text in the text box when the user clicks on the button ,
  2. Step 2: Click on "MATLAB" in the launch pad to expand the list and then double click on "GUIDE (GUI Builder)".

  3. Step 3: Click on the "ok" button in the left hand side of the window.

  4. Step 4: Move the mouse to somewhere on the grey area in the center of the window.

  5. Step 5: Click once and hold down the button and drag your mouse until the square that this forms is of the size you'd like

  6. Step 6: Release the mouse button and you will see your push button appear

  7. Step 7: Double click on the pushbutton you just created.

  8. Step 8: Locate the "string field" and click the area to the right of it and type "Say Hello".

  9. Step 9: Find the button on the left labeled "txt" and follow the same step 8 again

  10. Step 10: Now click on file then save to save your work.

  11. Step 11: Locate the line of code in the code editor that says function varargout = pushbutton1_Callback(h

  12. Step 12: eventdata

  13. Step 13: handles

  14. Step 14: varargin).

  15. Step 15: Write set.

Detailed Guide

If you cannot see the launch pad, click on view followed by launch pad.

The GUI builder will appear , This will allow you to drag and drop a pushbutton. ,,,, A property manager will pop up , Also Change the Tag to "button"

, This will also pop up the code for your program. , This is the callback function.

Any code below this will be executed whenever the user pushes the button.

Here we will make this change the text in the text box when the user clicks on the button ,

About the Author

D

Donald Stokes

Experienced content creator specializing in practical skills guides and tutorials.

45 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: