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...
Step-by-Step Guide
-
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 , -
Step 2: Click on "MATLAB" in the launch pad to expand the list and then double click on "GUIDE (GUI Builder)".
-
Step 3: Click on the "ok" button in the left hand side of the window.
-
Step 4: Move the mouse to somewhere on the grey area in the center of the window.
-
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
-
Step 6: Release the mouse button and you will see your push button appear
-
Step 7: Double click on the pushbutton you just created.
-
Step 8: Locate the "string field" and click the area to the right of it and type "Say Hello".
-
Step 9: Find the button on the left labeled "txt" and follow the same step 8 again
-
Step 10: Now click on file then save to save your work.
-
Step 11: Locate the line of code in the code editor that says function varargout = pushbutton1_Callback(h
-
Step 12: eventdata
-
Step 13: handles
-
Step 14: varargin).
-
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
Donald Stokes
Experienced content creator specializing in practical skills guides and tutorials.
Rate This Guide
How helpful was this guide? Click to rate: