Your SlideShare is downloading. ×
0
Creating a GUI in Matlab                               USING GUIDEBy Sahil Potnis, VIT, Mumbai
STEP 1: Open Matlab and type „guide‟ in command window . Guide stands for GUI Development Environment.OR You can select...
Create New GUI    By Sahil Potnis, VIT,    Mumbai
STEP 2: Select a standard template from the list:Say for example : GUI with uicontrols Save the GUI with a certain name ...
STEP 3: All objects present within the GUI have their own  tags. Double click on an object to display it „s properties ...
 If you change the tag, and save the file automatically   abc.m will be updated (note-Do not alter the .m file to change...
 Now I will explain rest of basics using reference to the   “Density * volume =Mass example” Density, Volume are the Edi...
STEP 4 : Mutual Exclusivity of these radio buttons is preserved as   they are embedded within a “button group‟‟ container...
 Functions related to specific Objects can be viewed   by using : View CallbackBy Sahil Potnis, VIT, Mumbai
 You can further change the „calculate callback‟  function as per your usage: Even a function can be created within „cal...
 Function [mass]=fxname(density,volume)%CODE%return Make sure the parameter names and number of  parameters within the f...
EXPECTED OUTCOME :   You can now create a simple User Interface with User     Input and perform certain operations on tho...
Thank You For further advanced Matlab programming visit :  http://sahilpotnis.blogspot.in/ Or drop me a mail at :sahil.p...
Upcoming SlideShare
Loading in...5
×

GUI in Matlab - 1

2,557

Published on

A small Introduction to GUI designing in Matlab Using GUIDE.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,557
On Slideshare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
136
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "GUI in Matlab - 1"

  1. 1. Creating a GUI in Matlab USING GUIDEBy Sahil Potnis, VIT, Mumbai
  2. 2. STEP 1: Open Matlab and type „guide‟ in command window . Guide stands for GUI Development Environment.OR You can select File-> new-> GUI.It is one and the same thing......By Sahil Potnis, VIT, Mumbai
  3. 3. Create New GUI By Sahil Potnis, VIT, Mumbai
  4. 4. STEP 2: Select a standard template from the list:Say for example : GUI with uicontrols Save the GUI with a certain name –abc This generates a abc.m file with the GUI code. Now , you can play with the code. Do not alter the initialization code up to line no:74By Sahil Potnis, VIT, Mumbai
  5. 5. STEP 3: All objects present within the GUI have their own tags. Double click on an object to display it „s properties Tag property will show you the existing tag of that object. Callback and Create function of these are associated with this tagBy Sahil Potnis, VIT, Mumbai
  6. 6.  If you change the tag, and save the file automatically abc.m will be updated (note-Do not alter the .m file to change the tag, make changes in .fig file and save it). Ta of your selected object is displayed at the right hand bottom corner of your .fig window.By Sahil Potnis, VIT, Mumbai
  7. 7.  Now I will explain rest of basics using reference to the “Density * volume =Mass example” Density, Volume are the Edit text boxes in which user can enter the values Mass is the static text box in which answer is displayed. Calculate and Reset are the two Pushbuttons while Units consists of two radio buttonsBy Sahil Potnis, VIT, Mumbai
  8. 8. STEP 4 : Mutual Exclusivity of these radio buttons is preserved as they are embedded within a “button group‟‟ container. A create function is essential when a value is to be obtained from the User A callback function is essential when a value is to be assigned to a certain tag (static text) Or a certain object has to perform a specific task (pushbutton)By Sahil Potnis, VIT, Mumbai
  9. 9.  Functions related to specific Objects can be viewed by using : View CallbackBy Sahil Potnis, VIT, Mumbai
  10. 10.  You can further change the „calculate callback‟ function as per your usage: Even a function can be created within „calculate‟ as follows:Mass=fxname(handles.metricdata.density,handles.metricdat.volume) Save a fxname.m file within the same folder and write the function within that file.By Sahil Potnis, VIT, Mumbai
  11. 11.  Function [mass]=fxname(density,volume)%CODE%return Make sure the parameter names and number of parameters within the function and main file match.By Sahil Potnis, VIT, Mumbai
  12. 12. EXPECTED OUTCOME :  You can now create a simple User Interface with User Input and perform certain operations on those input values.... Keep on trying new things.....Its the best way to learn.!!Watch out this space for tutorials on Matlab.... By Sahil Potnis, VIT, Mumbai
  13. 13. Thank You For further advanced Matlab programming visit : http://sahilpotnis.blogspot.in/ Or drop me a mail at :sahil.potnis@vit.edu.inBy Sahil Potnis, VIT, Mumbai
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×