How to create a simple graphical user interface in Matlab

Author: William Ramirez
Date Of Creation: 16 September 2021
Update Date: 1 July 2024
Anonim
How to Create a GUI with GUIDE - MATLAB Tutorial
Video: How to Create a GUI with GUIDE - MATLAB Tutorial

Content

Matlab is a powerful math tool for matrix calculations and any other math function. Matlab also has the ability to use its own programming language to create windows that resemble regular applications.

Steps

  1. 1 Open Matlab and wait for it to fully load.
  2. 2 On the launcher, click on "MATLAB" to expand the full list, and then double-click on "GUIDE (GUI Builder)". If you don't see the launcher, click on the "View" menu item and then on "Launch pad". The "GUI Builder" visual programming environment will start.
  3. 3 On the right side of the screen, click on the "Ok" button. This will allow you to drag the button.
  4. 4 Move your mouse to the gray area in the center of the window.
  5. 5Press the mouse button and, while holding it down, move the mouse pointer so that the resulting rectangle that forms the button becomes the size you need
  6. 6 Release your mouse button and you will see your button.
  7. 7 Double click on the created button. The property manager will appear.
  8. 8 Find "String field", click on the field to the right of this label and type "Hello". Also change the tag to "button".
  9. 9 On the left, find the button labeled "txt" and follow the same steps as in step 8.
  10. 10 Now select the "File" menu item and then "Save" to save what you created. After that, the code of your program will appear.
  11. 11 In the editor, find the line of code that says function varargout = pushbutton1_Callback (h, eventdata, handles, varargin). This is a callback function. When the user clicks on the button, the code below this line will be executed. In this case, when the user clicks the button, the text in the text box will change.
  12. 12 Write a set of commands.