MATLAB GUI Tutorial - For Beginners | blinkdagger

http://blinkdagger.com/matlab/matlab-gui-graphical-user-interface-tutorial...

an Engineering and MATLAB blog Home Listchecker MATLAB Contact About

23 Oct 2007 Quan Quach 279 comments 106,587 views Why use a GUI in MATLAB? The main reason GUIs are used is because it makes things simple for the end-users of the program. If GUIs were not used, people would have to work from the command line interface, which can be extremely difficult and fustrating. Imagine if you had to input text commands to operate your web browser (yes, your web browser is a GUI too!). It wouldn’t be very practical would it? In this tutorial, we will create a simple GUI that will add together two numbers, displaying the answer in a designated text field.

This tutorial is written for those with little or no experience creating a MATLAB GUI (Graphical User Interface). Basic knowledge of MATLAB is not required, but recommended. MATLAB version 2007a is used in writing this tutorial. Both earlier versions and new versions should be compatible as well (as long as it isn’t too outdated). Lets get started!

Initializing GUIDE (GUI Creator) Creating the Visual Aspect of the GUI: Part 1 Creating the Visual Aspect of the GUI: Part 2 Writing the Code for the GUI Callbacks Launching the GUI Troubleshooting and Potential Problems Related Posts and Other Links

1. First, open up MATLAB. Go to the command window and type in guide.

1 of 69

10/26/2010 4:10 PM

MATLAB GUI Tutorial - For Beginners | blinkdagger

http://blinkdagger.com/matlab/matlab-gui-graphical-user-interface-tutorial...

2. You should see the following screen appear. Choose the first option Blank GUI (Default).

3. You should now see the following screen (or something similar depending on what version of MATLAB you are using and what the predesignated settings are):

4. Before adding components blindly, it is good to have a rough idea about how you want the graphical part of the GUI to look like so that it’ll be easier to lay it out. Below is a sample of what the finished GUI might look like.

2 of 69

10/26/2010 4:10 PM

MATLAB GUI Tutorial - For Beginners | blinkdagger

http://blinkdagger.com/matlab/matlab-gui-graphical-user-interface-tutorial...

1. For the adder GUI, we will need the following components Two Edit Text components Three Static Text component One Pushbutton component Add in all these components to the GUI by clicking on the icon and placing it onto the grid. At this point, your GUI should look similar to the figure below :

2. Next, its time to edit the properties of these components. Let’s start with the static text. Double click one of the Static Text components. You should see the following table appear. It is called the Property Inspector and allows you to modify the properties of a component.

3 of 69

10/26/2010 4:10 PM

MATLAB GUI Tutorial . i. Let’s also change the font size from 8 to 20. This can be fixed if you resize the component.com/matlab/matlab-gui-graphical-user-interface-tutorial. I kept it simple and named it MyAdderGUI. change the String parameter to whatever you want as the title to your GUI. We’re interested in changing the String parameter. 3. but instead of changing the String parameter to +.For Beginners | blinkdagger http://blinkdagger. we want to modify the Tag parameter for this component.. 4 of 69 10/26/2010 4:10 PM . 6.. After modifying these properties. 5. Now. For the final Static Text component. do the same for the next Static Text component. as you have probably already have guessed.e. we want to set the String Parameter to 0. Go ahead and edit this text to +. 4. For the third Static Text component. This component will be used to display our answer. In addition. change it to =. Let’s call it answer_staticText. use your mouse cursor and stretch the component to make it larger. You can also experiment around with the different font options as well. the component may not be fully visible on the GUI editor. The Tag parameter is basically the variable name of this component.

For the second Edit Text component.. We want to set the String parameter to 0 and we also want to change the Tag parameter to input1_editText. you should have something that looks like the following: 1. Change the String parameter to Add! and change the Tag parameter to add_pushbutton. Finally. lets modify the Edit Text components.For Beginners | blinkdagger http://blinkdagger.. 2. as shown below. Pushing this button will display the sum of the two input numbers. This component will store the second of two numbers that will be added together.com/matlab/matlab-gui-graphical-user-interface-tutorial. 5 of 69 10/26/2010 4:10 PM . So now. we need to modify the pushbutton component. This component will store the first of two numbers that will be added together. 7. Double click on the first Edit Text component.MATLAB GUI Tutorial . set the String parameter to 0 BUT set the Tag parameter input2_editText. Next. 3.

The ..com/matlab/matlab-gui-graphical-user-interface-tutorial. You should have something like this when you are done: 5. Now.m file contains all the code for the GUI.For Beginners | blinkdagger http://blinkdagger.fig file contains the graphics of your interface. 6 of 69 10/26/2010 4:10 PM . I chose to name mine myAdder.m. When you save this file. The .MATLAB GUI Tutorial . MATLAB automatically generates two files: myAdder. you should have something like this: Rearrange your components accordingly. save your GUI under any file name you please.. 4.fig and myAdder. So now.

'String'. handles) % hObject handle to input1_editText (see GCBO) % eventdata reserved . Add the same block of code to input2_editText_Callback. This piece of code simply makes sure that the input is well defined. if the string %is not a number then input will be empty input = str2num(get(hObject. 1. click on the icon. 4..input2_editText. MATLAB automatically generates an . 3. 2.m file to go along with the figure that you just put together.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) Here is the code that we will add to this callback: a b % % = get(handles. %checks to see if input is empty.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject. Select input1_editText_Callback. This can save you from potential headaches later on. if so.Executes on button press in add_pushbutton. You don’t have to worry about any of the other function types. For now.'String')). We don’t want the user to put in inputs that aren’t numbers! The last line of code tells the gui to update the handles structure after the callback is complete.'String').m file. a and b are variables of Strings type. In the MATLAB editor. Open up the .For Beginners | blinkdagger http://blinkdagger. which will bring up a list of the functions within the . Now we need to edit the add_pushbutton_Callback. you should take it at face value that it’s a good idea to end each callback function with guidata(hObject.input1_editText. we are primarily concerned only with the callback functions.m file that was automatically generated when you saved your GUI. eventdata. function add_pushbutton_Callback(hObject. and need to be converted to variables of Number type before they can be added together total = str2num(a) + str2num(b). default input1_editText to zero if (isempty(input)) set(hObject.'String').m file. handles).'0') end guidata(hObject.'String') returns contents of input1_editText as text % str2double(get(hObject.com/matlab/matlab-gui-graphical-user-interface-tutorial. The handles stores all the relevant data related to the GUI. handles). The % --. For the purposes of this tutorial. icon and select add_pushbutton_Callback. The .. This topic will be discussed in depth in a different tutorial.'String')) returns contents of % input1_editText as a double Add the following code to the bottom of that code block: %store the contents of input1_editText as a string. handles) % hObject handle to add_pushbutton (see GCBO) % eventdata reserved .MATLAB GUI Tutorial . = get(handles. c = num2str(total). 7 of 69 10/26/2010 4:10 PM .m file is where we attach the appropriate code to the callback of each component. The cursor should take you to the following code block: function input1_editText_Callback(hObject. Click on the following code block is what you should see in the . eventdata. so that the handles are always updated after each callback.

Congratulations. If you don’t want MATLAB to automatically generate all those comments for each of the callbacks.'String'.. Since they are variables of String type. From the GUI editor.com/matlab/matlab-gui-graphical-user-interface-tutorial. If you did not convert it back into a String type. and not Number type. This line of code populates the Static Text component with the variable c. 8 of 69 10/26/2010 4:10 PM . 7. The following line of code is used to add the two inputs together.input1_editText. It is now time to launch the GUI! 8. Now we just need to send the sum of the two inputs to the answer box that we created.input2_editText. we’re finished coding the GUI. handles). We can convert variables of String type to Number type using the MATLAB command str2num(String argument).answer_staticText. guidata(hObject. c = num2str(total).For Beginners | blinkdagger http://blinkdagger. Don’t forget to save your m-file. total= (str2num(a) + str2num(b)). Thus.'String'. The last line of code updates the handles structures as was previously mentioned. This is done using the following line of code.c). 6. 5. The reason we convert the final answer back into String type is because the Static Text component does not display variables of Number type.'String'). handles). b = get(handles.c). guidata(hObject. there is a way to disable this feature. then to Preferences. Similarly. Let’s discuss how the code we just added works: a = get(handles. The two lines of code above take the strings within the Edit Text components.'String').. and stores them into the variables a and b.MATLAB GUI Tutorial . we can do the opposite using num2str(Number argument). The next line of code converts the sum variable to String type and stores it into the variable c.answer_staticText. % need to convert the answer back into String type to display it set(handles. the GUI would run into an error when it tries to display the answer. we must convert a and b to Number type before MATLAB can add them together. go to File. we cannot simply add them together. set(handles.

. There are two ways to launch your GUI.com/matlab/matlab-gui-graphical-user-interface-tutorial. type in the name of the GUI at the command prompt (you don’t need to type the .fig and .fig or .MATLAB GUI Tutorial . The first way is through the GUIDE editor. First.m extension): 9 of 69 10/26/2010 4:10 PM .For Beginners | blinkdagger http://blinkdagger. set the MATLAB current directory to wherever you saved your .. Simply press the below: icon on the GUIDE editor as shown in the figure The second method is to launch the GUI from the MATLAB command prompt. 1.m file. Next.

'String'). if you have the following line in your code. make sure your component Tags are consistent between the . Congratulations on creating your first GUI! So your GUI doesn’t work and you don’t know why. The GUI should start running immediately: Try to input some numbers to test out the GUI. Here are a couple of tips that might help you find your bug: 1. if you’re trying to extract the string from the Edit Text component.. 5. The command line can give you many hints on where exactly the problem resides. 10 of 69 10/26/2010 4:10 PM .fig and the . The line number of the faulty code and a short description of the error is given. If you can’t figure out where you error is.MATLAB GUI Tutorial .For Beginners | blinkdagger http://blinkdagger.. In addition. 2. leave a comment here and we’ll try our best to help. If all else fails. The source code is available here. Make sure all your variable names are consistent in the code.com/matlab/matlab-gui-graphical-user-interface-tutorial.input1_editText. 2. This is always a good place to start investigating. 4. For example. If your GUI is not working for any reason. it might be a good idea to quickly go through this tutorial again. make sure that your get statement uses the right tag! More specifically. make sure that you named the Edit Text component accordingly! a = get(handles. 3. the error will be outputted to the command prompt. and could be useful for debugging purposes.m file.

Can you add a further tutorial on how to plot data in a set of axes in the GUI? 3. but I’ll try to answer it anyways. 4. and have it populate the axes on a GUI with a plot? I’d love to help. say “e”..Pop-up Menu MATLAB GUI Tutorial . Are you asking if there is a way to press a particular key. 279 Responses to “MATLAB GUI (Graphical User Interface) Tutorial for Beginners” 1. on 20 Nov 2007 at 10:04 am 1Mike Thanks for the tutorial .MATLAB GUI Tutorial . is it possible to send let say. I will be in better shape to answer! Quan 6. so if you can clarify your question.. on 16 Dec 2007 at 8:32 pm 6zuri Hi!.its nice and clear 2.A Brief Introduction to handles MATLAB GUI Tutorial .Sharing Data among Callbacks and Sub Functions Video Tutorial: GUIDE Basics More GUI Tutorial Videos From Doug Hull This is the end of the tutorial. zuri 11 of 69 10/26/2010 4:10 PM . I’m not sure if I’m understanding your question exactly. on 28 Nov 2007 at 12:36 pm 3Quan Quach You can find the tutorial on plotting data to a set of axes here. including the axes. have a GUI running simultaneously with a live figure responding to KeyPressFcn? 5. sine wave plot from one GUI window to another GUI window via UDP IP connection (using same computer)? thanks.Slider MATLAB GUI Tutorial . and your approach with simple examples and easily modified code is perfect. If you look here. MATLAB GUI Tutorial .Plotting Data to Axes MATLAB GUI Tutorial . it’ll show you how to enter the command line mode so that you can modify any of the GUI’s components in real time. but I have a question. myAdder GUI tutorial very useful for beginner like me. on 28 Nov 2007 at 4:06 pm 5Quan Quach Hello Fred.com/matlab/matlab-gui-graphical-user-interface-tutorial. on 28 Nov 2007 at 3:04 pm 4Fred First of all. But I think you may be asking something different. First of all. I was having some success with KeyPressFcn to make a graph with live keyboard input. I greatly appreciate these tutorials.Button Types and Button Group MATLAB GUI Tutorial . on 28 Nov 2007 at 11:54 am 2Fred Extremely useful.For Beginners | blinkdagger http://blinkdagger. I have found the Matlab documentation simply unreadable on the subject of GUIs. Is there any way to integrate this into a graph in a GUI? Or alternatively. You can find a list of matlab tutorials here.

on 17 Dec 2007 at 4:25 am 7Gil Hello Quan.do?objectId=12122&objectType=FILE Diego 10. Thanks Would you please provide the pdf file of the tutorial so it can be printed? 11.com)or (ravikumar_l7@yahoo. I want the cursor position to respond to key strokes (arrows). But for now.in) 14. 12. Regards. Gil: I emailed you some code that I developed to explain this. 7.MATLAB GUI Tutorial .y). ‘r’ for refresh. thank u very much. Great tutorial.co.please contact us in my email (ravikumar_l7i@rediffmail. I will probably turn this into a tutorial in the immediate future 9. on 11 Jan 2008 at 7:10 am 12Philips Wang Simple but very useful! Thanks a lot. etc.mathworks. Gil 8. on 17 Dec 2007 at 4:33 am 8Quan Quach Zuri: I’m a little confused on what you’re trying to accomplish. and a pointer (little cross or whatever) to a current point (x.I am a beginner! 13.com/matlab/matlab-gui-graphical-user-interface-tutorial. on 08 Jan 2008 at 5:43 pm 11Quan Quach Hello Vahid.c hello friends i am ravi chaudhary .). but don’t know how to trigger it with the keystrokes. and various shortcuts (say ‘Ctrl+F’ for toggling a filter... on 18 Dec 2007 at 7:27 pm 9Diego Barragán See also: http://www. if you can elaborate then perhaps I might have an answer.com/matlabcentral/fileexchange/loadFile. if anybody help me for creating source code for my project . This is something that we are currently working on and hope to have available in the near future.For Beginners | blinkdagger http://blinkdagger. i done the project in fingerprint recognition in matlab. this gui tutorial help me to creating the framework of my project. on 08 Jan 2008 at 11:26 am 10Vahid Very useful. I know how to implement the movement of the cursor on the image. we don’t have this capability. I am trying to create a GUI that displays an image. on 19 Jan 2008 at 1:02 am 14ali 12 of 69 10/26/2010 4:10 PM . loved it! I’m having a problem similar to Fred’s here (I think). on 11 Jan 2008 at 12:43 pm 13ravi .

guys like you make it easier for guys like me! Regards 22. on 17 Feb 2008 at 5:21 pm 22Quan Quach 13 of 69 10/26/2010 4:10 PM . I think your screen shot more clearly defines the variable name by its blue color any ideas? 2) I am quite confused on the ‘handles’ versus ‘hObject’ . My editor shows these in black type ?? I have looked at the preference settings but cannot change this but the code works and no errors.. on 13 Feb 2008 at 7:46 am 20Hank_Chinaski Thanks a lot guys. I contructed your Gui and works fine and I think I understand the basic parts of your GUI code. Two questions though: 1) Your first added code block.. I think it was nicely put together and very understandable.I am very new to Matlab (7.where will be this readed image stored. Can you explain how we can create a button for browsing an image for doing further process.MATLAB GUI Tutorial . 21.pls give the . ‘input = str2num(get(hObject.com/matlab/matlab-gui-graphical-user-interface-tutorial.I am still trying to understand terminology and syntax.Am I right in thinking ‘handles’ are for data being sent somewhere else and ‘hObject’ for data being received? . realy nice topic i wonder if u can provide more of this thanx alot 15. pls mail to my email ID 19. if you click on the “matlab” tap at the top of the page.For Beginners | blinkdagger http://blinkdagger. but I have a one question.’String’)). Anyway . on 17 Feb 2008 at 5:14 pm 21Dave Barr Hi . on 22 Jan 2008 at 2:19 am 15mohd muzafar thanks to teach a simple GUI but i wonderful to know how to make analysis of buried optical waveguide channel using finite difference method using gui… 16..m codes.thanks for it….whether this image can be seened. on 25 Jan 2008 at 4:56 am 17Amol Its realy amazed me with simplicity u xplained the GUI customsn… its gr8 help 4 me…thx 18. This made it all much clearer than the guys from Mathworks. on 22 Jan 2008 at 10:28 pm 16Quan Quach thanks for the feedback guys. do you have it in English? Thanks Lukasz 20.0) and climbimg the steep learning curve. on 29 Jan 2008 at 10:55 am 18uvise I get an idea about gui….tks for you time . you will see a list of tutorials or you can click here 17. on 08 Feb 2008 at 6:51 am 19Lukasz Hello Diego Barragán Your tutorial is really useful.’ shows the variable ‘input’ and ’str2num(get’ in blue type.

Now how i have this i’m satisfied. So for example. Thank you! San 14 of 69 10/26/2010 4:10 PM . hObject in this case is the “add” button object. if I pressed the “add” button. When I input a number into the left edit text field.com/matlab/matlab-gui-graphical-user-interface-tutorial. I used the KeyPressFcn to count a number of pressed keys and compare it to 0. so my ideia is to make a limit os 3 chars on this edit text box. on 25 Feb 2008 at 11:47 pm 24Hugo Hi my friend. Hugo 25. is the active object from which the callback is called. Quan 26. 1) The coloring scheme is a little bit off due to the wordpress plugin that I use. Very tahnk’s to your pacience. But also with this things isn’t perfect.. Hi Dave. Another example. Excellent and clear work Dave 24.blinkdagger.. on 26 Feb 2008 at 5:47 pm 25Quan Quach Hello Hugo. I could find this link very useful. but if i can make better i will more happy So if you can give me any trick or any ideia. 2) The handles structures contain’s all the information about all of the GUI’s objects. The explanation was done in a very lucid manner. so i have a edit text box where i write the 3 digits of a IP address(0…255). I will continue with your tutorials as you suggest.For Beginners | blinkdagger http://blinkdagger. I search a lot in help of matlab. I spend a few hours to make some things that you have here in your site. hObject on the other hand. on 18 Feb 2008 at 1:32 am 23Dave Barr Quan. thanks you so much for your quick reply. I’ll have to look into it. There are a bunch of other tutorials that you can find on this website. on 27 Feb 2008 at 6:08 am 26San hello Hugo. Nice work . and very thank’s to you disponibility to make this tutorials. or any link to internet i will very appreciated. String regards.MATLAB GUI Tutorial .com/matlab/matlab-gui-tutorial-a-brief-introduction-to-handles 23.9 if is backspace or delete e decraise one number of this count. I’ll let you know if I find anything. After when i will read the data of all edit boxs i compare the text of the edit box with 0…255 and if is a letter os >255 o put ‘0′. but i can’t found any info to make something like this. I recommend taking a look at this one for a better understanding: http://www. now i can found and i can see that i’m a good way. and also in internet. But i have a little thing that i want to make better.. I’m not quite sure how to do this off the top of my head. hObject is the edit text object.

??? Error using ==> myAdder(’add_pushbutton_Callback’. Error in ==> myAdder>add_pushbutton_Callback at 134 a = get(handles.guidata(gcbo)) Attempt to reference field of non-structure array.’String’).m’. ??? uiopen(’C:\Documents and Settings\F3\My Documents\ani’s fyp\MATLAB\GUI\MATLAB_GUI_Tutorial for beginners(blinkdagger)-troubleshooting\myAdder.input1_editText. 27.1) | Error: Unexpected MATLAB expression.’String’). Error in ==> myAdder>add_pushbutton_Callback at 134 a = get(handles. Error in ==> gui_mainfcn at 95 feval(varargin{:}). ??? Error while evaluating uicontrol Callback >> can u explain to me p/s:sori for my english 29. here the error i got when i run the source code download from this page. on 29 Feb 2008 at 10:09 pm 29Quan Quach meeb download the source files.now i’m really confuse..For Beginners | blinkdagger http://blinkdagger. varargin{:}).gcbo. on 29 Feb 2008 at 10:03 pm 28meeeeebbbb i’ve tried the tutorial step-by-step but i got error. i still got error even i’ve rewrite and corrected the code twice. Error in ==> gui_mainfcn at 95 feval(varargin{:}). on 28 Feb 2008 at 8:55 pm 27izzy how we do linear regression using GUI how to display the equation or model?? help me… 28. then i tried to run the source code provided at this page and when i run it. varargin{:}). Error in ==> myAdder at 42 gui_mainfcn(gui_State.input1_editText. place them into a directory.[]. 15 of 69 10/26/2010 4:10 PM .MATLAB GUI Tutorial . still got the same error. Error in ==> myAdder at 42 gui_mainfcn(gui_State..com/matlab/matlab-gui-graphical-user-interface-tutorial. ??? Error using ==> myAdder(’add_pushbutton_Callback’.[]. ??? Error while evaluating uicontrol Callback ??? Attempt to reference field of non-structure array. ??? Attempt to reference field of non-structure array.gcbo.guidata(gcbo)) Attempt to reference field of non-structure array.

achei simples e bem pratico. make sure the matlab current directory is the same as above at the command prompt. How to do that? Thank you very much..thanks 35. on 20 Mar 2008 at 8:09 am 32mini OMG thank you for this tutorial! It’s really a lifesaver! 33.mdl)? It’s like if you want to make GUI to take the data (input).com/matlab/matlab-gui-graphical-user-interface-tutorial. How to make a GUI that connects to simulink (*. I am trying to create a GUI which differentiates a function so input is going to be a function of time or just a number.. Regards 31. on 02 Apr 2008 at 10:19 pm 33suri good tutorial. on 12 Mar 2008 at 7:14 am 30Pradipta Thank you very much for the tutorial. it is easer to use . The output will also be a function or a number. type: myAdder Please give that a try 30.blinkdagger. Thanks. 16 of 69 10/26/2010 4:10 PM . Pls help... From now on... Regards Suri 34.] with some experience creating a Matlab GUI. on 14 Mar 2008 at 2:21 pm 31Quan Quach Pradipta. I am ready to make GUI on matlab. Basic knowledge of Matlab and an understanding on how data is shared among callbacks is highly [.For Beginners | blinkdagger http://blinkdagger.MATLAB GUI Tutorial . on 03 Apr 2008 at 5:59 am 34davyd gostei do tutorial .. you should visit this tutorial first.com/matlab/matlab-gui-tutorial-integrating-simulink-model-into-a-gui 32. what will be code for converting string to function and how to use it. But. Try this tutorial: http://www. If you’re new to creating GUIs in Matlab. on 04 Apr 2008 at 5:06 am 36Adam Bright Hi.] 36. I would like to ask you some question.. and do the process in simulink.Disable Mouse Clicking [. on 03 Apr 2008 at 10:58 pm 35innovate » Matlab GUI Tutorial . i enjoyed the tutorial .

but only the date) I have’nt clue if this is even possible. my question is how do i get the user to view the array time. If I was to create a clear pushbutton which resets the value displayed in the static text. on 05 Apr 2008 at 3:48 am 37sunny I have to cerat a GUI project for finding the resistance value from color code.’.g they would only require the data from the 5th row til the end.raininput] = textread(’rain.So.number. or too advanced.Therefore we have 4 panels in which we have to insert radio buttons. One of the first GUI tutorials I’ve seen that wasn’t too simple. Thanks for the positive feedback!! Quan 43.pressure.you should think about publishing a book.txt’. any help would be really appreciated. in my code i have the following: [time. ( however they shouldn’t see the row no. 42. thanks very much.For Beginners | blinkdagger http://blinkdagger. now i got a hope of completing my project!!! 44. on 12 Apr 2008 at 2:32 am 42Quan Quach Jim.one block for finding resistance value & one for closing the window.MATLAB GUI Tutorial . This tutuorial is simple and CLEAR. on 11 Apr 2008 at 1:52 am 40andy may i know why i cant prevent user to key in other thing than number? I also cant open the source file downloaded? is this because i using Matlab 6 rather than 7? 41.what code would I write under the pushbutton function? thanks 17 of 69 10/26/2010 4:10 PM .'.I’ve got 5. and from that select the range they require? (preferably in listbox.. on 10 Apr 2008 at 1:01 am 39ckk nice tutorial.so i can use for a gui plot) e. Brilliant website.'headerlines’. on 23 Apr 2008 at 9:45 am 44Jamal Hi Quan.'delimiter’.. on 09 Apr 2008 at 9:45 pm 38knight its nice n comprehensive 39. 38. on 17 Apr 2008 at 11:46 am 43harsha great work sir. {brilliant tutorials by the way . on 11 Apr 2008 at 10:52 pm 41Jim Nice..com/matlab/matlab-gui-graphical-user-interface-tutorial.suggest me programme for it along with callback functions of radio buttons.'%s %d %f %f’.4).. A large amount of MATLAB users don’t code with GUI’s because the process was never clearly explained to them.but yours is the easiest to understand!} 37.may i ask that is there any way that can limit the length of numbers which user can input ? 40.

on 08 May 2008 at 5:46 am 48Marcus Hi.answer_staticText. I have what is probably a very simple question but I just can’t find the answer: How do I save my GUI as a jpeg so that I can use it in a report? (I’m working on a mac) Thanks Roisin 51. on 16 Jul 2008 at 1:43 am 53Temy 18 of 69 10/26/2010 4:10 PM . Please help me to solve the problem … I am the beginner of using GUI. the warning that is “Requires string or character array input” even I copy the example in the above.’String’. 46. easy & comfortable to study thanks. Is there anyway of avoiding or disabling this? Thanks 49. 52. on 20 Jun 2008 at 9:39 am 51eva I have a problem to build up a simple GUI with a context graph y = a sin(x) where ‘a’ can be change by user with an edit box … However. there is an error when using str2num. Thanks. it automatically goes into the editText box (i. the user doesn’t have to click in the box in order to type their input). on 27 Jun 2008 at 5:40 am 52vinay hi i have following error in my gui code. on 11 Jun 2008 at 10:41 am 50Roisin Hi. on 05 May 2008 at 2:07 am 47iran fars thanks for your help..please help me: ??? Reference to non-existent field with regards Vinay 53.com/matlab/matlab-gui-graphical-user-interface-tutorial..MATLAB GUI Tutorial . I’ve noticed that MATLAB truncates values when setting edit or static text boxes. it suffers me a lot .. 47. on 23 Apr 2008 at 12:14 pm 45Daniel Sutoyo Jamal: set(handles.For Beginners | blinkdagger http://blinkdagger. the same error shown in using str2num. on 30 Apr 2008 at 11:52 am 46Peter Does anyone know how I can make the editText so that when the user types. 45.'Insert Default Static Text Here’). i could find very good information in your site 48. on 11 Jun 2008 at 1:53 am 49korean it’s nice to know about gui in MATlab.) 50.e.

m. I hope other tutorials are also very easy to understand. on 25 Aug 2008 at 3:28 pm 61Quan Quach Ben. Make sure all the files above are located in the same directory. Give that a try! Quan 62. on 21 Jul 2008 at 2:56 pm 54Anonymous danke meister für die hilfe thanks man for your help 55. The addpath command will add a path to the list of MATLAB paths and enable you to run scripts/guis from a different path other than the current matlab directory. and file(b). now what if I want the files to be in different directories? 63. 61. on 06 Aug 2008 at 5:32 am 57OnOffPT Thank you for all your tutorials. it’s very useful. file(b). on 21 Aug 2008 at 11:08 pm 59Reju Simple and usefull tutorial. but none of the buttons or controls work.fig. on 25 Aug 2008 at 3:32 pm 62Ben Thanks. 58.m file? Say I have file(a).MATLAB GUI Tutorial . 56. and they call the GUI successfully. 59..m. I will be looking forward to see the following tutorials.For Beginners | blinkdagger http://blinkdagger. They allow everyone to start developing GUIs very very fast while trying to understand what’s happening behind and learn.com/matlab/matlab-gui-graphical-user-interface-tutorial.. that worked. on 25 Aug 2008 at 5:37 pm 63Quan Quach Use the addpath command in the opening function of your main gui. on 04 Aug 2008 at 9:58 pm 56C Babu Hi salute to you…No one make this much easier GUI MATLAB tutorial 57. but how do I call my GUI from a separate *. this may be a beginner question. Thanks 60.m? I’ve tried a few ways. on 18 Aug 2008 at 2:34 am 58Nr Thank you very much for this nice tutorial. How do I call my file(b) GUI from file(a). on 25 Aug 2008 at 3:21 pm 60Ben Hey. I get the following error: ??? Error while evaluating uicontrol Callback Thanks. on 03 Aug 2008 at 10:37 am 55akbar hi thank u so much . But. 19 of 69 10/26/2010 4:10 PM . Thank you so much!!! It’s very helpful ^-^ 54.

that worked well! 65. The code for my GUI is function varargout = samplegui1(varargin) % SAMPLEGUI1 M-file for samplegui1. Thanks in advance.. i want to read in an input from a mirochip using a serial cable (DB9) and display that on the screen. i did create my own GUI with 2 push buttons and two text fields which take input for my second program I cannot figure outut a)I want to run my 2nd matlab program with the input given in the text fields on mouse click on the push button created.hObject.MATLAB GUI Tutorial .For Beginners | blinkdagger http://blinkdagger. thanks please email me at lnvp_17@yahoo. by itself. % % H = SAMPLEGUI1 returns the handle to a new SAMPLEGUI1 or the handle to % the existing singleton*. on 04 Sep 2008 at 3:50 pm 66Qing This is the best tour for GUI I have ever seen.M with the given input arguments. All inputs are passed to samplegui1_OpeningFcn via varargin.com/matlab/matlab-gui-graphical-user-interface-tutorial. Quan 64. on 13 Sep 2008 at 8:29 am 67louis please help me in my project it is a dtmf door lock system...'Value'. creates a new SAMPLEGUI1 or raises the existing % singleton*..handles. Starting from the left.. An % unrecognized property name or invalid value makes property application % stop. you must first create a password and then you must login in the keypad created using dtmf and enter your password correctly please help me i need to pass this on or before tuesday please guys to those who are gifted with matlab skills…. Believe it or not. but what i am most concerned with is how do I use a GUI to display an external input on the screen???? 66. on 13 Sep 2008 at 11:40 am 68Suraj Hi . GUIDATA. Thanks a lot! 67. on 26 Aug 2008 at 3:04 pm 64Ben Thanks. Choose "GUI allows only one % instance to run (singleton)".) creates a new SAMPLEGUI1 or raises the % existing singleton*. This tutorial is of great help for me . % % *See GUI Options on GUIDE's Tools menu. % % See also: GUIDE. nor how to set up the cable. GUIHANDLES % Edit the above text to modify the response to help samplegui1 20 of 69 10/26/2010 4:10 PM . % % SAMPLEGUI1('Property'...fig % SAMPLEGUI1. they’re great. property value pairs are % applied to the GUI before samplegui1_OpeningFcn gets called. i was wondering if you could help me. I have no idea how to read in the input. % % SAMPLEGUI1('CALLBACK'. on 03 Sep 2008 at 8:42 am 65yaaseen Hi love the tutorials.eventData.com if youll help il refer you to my school mates Godbless 68..) calls the local % function named CALLBACK in SAMPLEGUI1.

@samplegui1_OutputFcn. % See ISPC and COMPUTER... end 21 of 69 10/26/2010 4:10 PM .'String') returns contents of edit1 as text % str2double(get(hObject. . end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State. 'gui_Singleton'. handles.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles. handles) % varargout cell array for returning output args (see VARARGOUT). % Update handles structure guidata(hObject. varargin{:}). 'gui_Callback'. % hObject handle to figure % eventdata reserved .. ischar(varargin{1}) gui_State. eventdata. []).&amp. function edit1_CreateFcn(hObject. if nargin &amp.'String')) returns contents of edit1 as a double % --. 'gui_LayoutFcn'. ... ..DO NOT EDIT gui_Singleton = 1. varargin{:}). [] . .output.5 12-Sep-2008 20:08:16 % Begin initialization code . 'gui_OutputFcn'.Outputs from this function are returned to the command line.. % UIWAIT makes samplegui1 wait for user response (see UIRESUME) % uiwait(handles.figure1).handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. isequal(get(hObject. % --. see OutputFcn.'BackgroundColor'.com/matlab/matlab-gui-graphical-user-interface-tutorial.MATLAB GUI Tutorial .output = hObject. @samplegui1_OpeningFcn. after setting all properties... varargin) % This function has no output args. else gui_mainfcn(gui_State. gui_State = struct('gui_Name'. handles). 'gui_OpeningFcn'. handles) % hObject handle to edit1 (see GCBO) % eventdata reserved .&amp.Executes during object creation. function samplegui1_OpeningFcn(hObject.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to samplegui1 (see VARARGIN) % Choose default command line output for samplegui1 handles. function edit1_Callback(hObject.. gui_Singleton.'defaultUicontrolBackgroundColor set(hObject. .. % Last Modified by GUIDE v2.to be defined in a future version of MATLAB % handles empty . if ispc &amp.'BackgroundColor').For Beginners | blinkdagger http://blinkdagger. % hObject handle to figure % eventdata reserved . eventdata. function varargout = samplegui1_OutputFcn(hObject. handles) % hObject handle to edit1 (see GCBO) % eventdata reserved .'white').to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject. mfilename. eventdata.DO NOT EDIT % --.gui_Callback = str2func(varargin{1}).. get(0. eventdata.Executes just before samplegui1 is made visible. end % End initialization code .

get(0. if item 1 is selected. on 24 Sep 2008 at 9:37 pm 69MAksat It awful 70...handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. I would like to have a different set of parameters for each of the items in the listbox.Executes during object creation.'BackgroundColor'). but if item 2 is selected. eventdata.For Beginners | blinkdagger http://blinkdagger. function figure1_CreateFcn(hObject. a different set of parameters will need to be input.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % -------------------------------------------------------------------function Untitled_1_Callback(hObject. on 13 Oct 2008 at 9:52 pm 70Felipe (Brazil) Thanks for the tutorial! It was very useful and works perfectly! 71.MATLAB GUI Tutorial .'String')) returns contents of edit2 as a double % --.Executes on button press in pushbutton2. eventdata.&amp.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --. handles) % hObject handle to figure1 (see GCBO) % eventdata reserved . % See ISPC and COMPUTER. eventdata. end % --.handles not created until after all CreateFcns called 69. after setting all properties. handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved . after setting all properties. eventdata. handles) % hObject handle to edit2 (see GCBO) % eventdata reserved . on 18 Oct 2008 at 2:27 pm 71Roy This is indeed the best tutorial among all that I have found on the web so far. eventdata.'white'). function pushbutton1_Callback(hObject. if ispc &amp. one set of parameters need to be input by the user by the GUI. handles) % hObject handle to Untitled_1 (see GCBO) % eventdata reserved . isequal(get(hObject.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --.'defaultUicontrolBackgroundColor set(hObject.Executes on button press in pushbutton1.'String') returns contents of edit2 as text % str2double(get(hObject.Executes during object creation. How can I do this? Thanks in advance! 22 of 69 10/26/2010 4:10 PM . handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved . function edit2_CreateFcn(hObject.com/matlab/matlab-gui-graphical-user-interface-tutorial. handles) % hObject handle to edit2 (see GCBO) % eventdata reserved . Thank you! I have a question regarding a specific feature I would like my GUI to have. eventdata.to be defined in a future version of MATLAB % handles empty . function pushbutton2_Callback(hObject.to be defined in a future version of MATLAB % handles empty . For example. function edit2_Callback(hObject.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject.'BackgroundColor'.

MATLAB GUI Tutorial . what should we write at the callback(of add) button? so that when we pressing add. on 02 Nov 2008 at 9:33 pm 74tasya if we created this interface.M with the given input arguments. % % *See GUI Options on GUIDE’s Tools menu.…) creates a new UNTITLED4 or raises the % existing singleton*.hObject.. … ‘gui_OutputFcn’. % % UNTITLED4(’CALLBACK’. gui_State = struct(’gui_Name’.7. i’m using visual v.…) calls the local % function named CALLBACK in UNTITLED4.. [] . on 19 Oct 2008 at 2:26 pm 72open_devel Thanks man. @untitled4_OpeningFcn. 72.handles.'Value’.but how to insert the function in? so that it will give us the final results?help mee function varargout = untitled4(varargin) % UNTITLED4 M-file for untitled4. … ‘gui_Callback’.fig % UNTITLED4. mfilename. 23 of 69 10/26/2010 4:10 PM .2 matlab 75.. []). by itself. @untitled4_OutputFcn. GUIDATA. gui_Singleton. if nargin && ischar(varargin{1}) gui_State. Good work! 73.5 03-Nov-2008 11:28:26 % Begin initialization code . end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State. creates a new UNTITLED4 or raises the existing % singleton*.eventData.gui_Callback = str2func(varargin{1}). Choose “GUI allows only one % instance to run (singleton)”.com/matlab/matlab-gui-graphical-user-interface-tutorial. An % unrecognized property name or invalid value makes property application % stop. % % H = UNTITLED4 returns the handle to a new UNTITLED4 or the handle to % the existing singleton*. % % See also: GUIDE. Starting from the left. on 02 Nov 2008 at 9:44 pm 75tasya i’ve created the GUI as u shown above.For Beginners | blinkdagger http://blinkdagger. how about the callback function we should write in? for examplee. % % UNTITLED4(’Property’. the numbers will be adding together and displayed the outcomes at the ’static box’ . … ‘gui_OpeningFcn’. All inputs are passed to untitled4_OpeningFcn via varargin. … ‘gui_LayoutFcn’. GUIHANDLES % Edit the above text to modify the response to help untitled4 % Last Modified by GUIDE v2. varargin{:}).DO NOT EDIT gui_Singleton = 1. property value pairs are % applied to the GUI before untitled4_OpeningFunction gets called. on 23 Oct 2008 at 5:48 pm 73Base thanks man… very helpful 74. the interface as u shown above. … ‘gui_Singleton’.

% — Outputs from this function are returned to the command line. function varargout = untitled4_OutputFcn(hObject.’String’)) returns contents of edit1 as a double % — Executes during object creation.’String’) returns contents of edit1 as text % str2double(get(hObject. varargin{:}). % hObject handle to figure % eventdata reserved .’BackgroundColor’. handles) % hObject handle to edit1 (see GCBO) % eventdata reserved . % See ISPC and COMPUTER.MATLAB GUI Tutorial .to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) 24 of 69 10/26/2010 4:10 PM .handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.figure1).DO NOT EDIT % — Executes just before untitled4 is made visible. handles). after setting all properties. handles) % varargout cell array for returning output args (see VARARGOUT). eventdata. end function edit2_Callback(hObject.to be defined in a future version of MATLAB % handles empty . see OutputFcn.’defaultUicontrolBackgroundColor’)) set(hObject. function edit1_Callback(hObject..For Beginners | blinkdagger http://blinkdagger. if ispc && isequal(get(hObject.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to untitled4 (see VARARGIN) % Choose default command line output for untitled4 handles.output = hObject.'white’). else gui_mainfcn(gui_State. % UIWAIT makes untitled4 wait for user response (see UIRESUME) % uiwait(handles.’BackgroundColor’). end % End initialization code . eventdata. eventdata. eventdata.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles. function edit1_CreateFcn(hObject. % Update handles structure guidata(hObject.. function untitled4_OpeningFcn(hObject. handles) %what shud i write here? % hObject handle to edit1 (see GCBO) % eventdata reserved . handles. % hObject handle to figure % eventdata reserved . handles) % hObject handle to edit2 (see GCBO) % eventdata reserved .to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject. get(0. varargin) % This function has no output args.output.com/matlab/matlab-gui-graphical-user-interface-tutorial. eventdata.

may i know why? 77. Plz help me asap. function edit2_CreateFcn(hObject.com/matlab/matlab-gui-graphical-user-interface-tutorial.to be defined in a future version of MATLAB % handles empty .’BackgroundColor’.For Beginners | blinkdagger http://blinkdagger. % See ISPC and COMPUTER.7. 79.’String’) returns contents of edit2 as text % str2double(get(hObject. on 18 Nov 2008 at 12:53 am 78sasi hi.. eventdata. Error in ==> MyAdder at 42 myadder_mainfcn(myadder_State.’BackgroundColor’). on 03 Nov 2008 at 3:50 am 76tasya i’m using the source code(which i dload from u) and try to run in matlab GUI V. Thank you:) 78. if ispc && isequal(get(hObject.'white’). after setting all properties. But I get the same error despite following the same steps. handles) % hObject handle to edit2 (see GCBO) % eventdata reserved .to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) text3=edit1+edit2.. handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved . eventdata.’defaultUicontrolBackgroundColor’)) set(hObject. function pushbutton1_Callback(hObject.’String’)) returns contents of edit2 as a double % — Executes during object creation.. The error goes like this: Undefined command/function ‘myadder_mainfcn’. varargin{:}). % Hints: get(hObject. on 10 Nov 2008 at 3:55 pm 77Chiaotinger This is really nice! I think I will put aside excel VBA and embrace MATLAB GUI now. First of all thanks a lot for the tuorial.handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. on 27 Nov 2008 at 4:51 pm 80pero please i need to make a button called browse to load image in axis i have 2 axis one for original image and second after applaying any filter i want to know as`uick how can ii do that 25 of 69 10/26/2010 4:10 PM . get(0. end % — Executes on button press in pushbutton1.MATLAB GUI Tutorial .2… but it stated error. <———-is this the correct way? %text3 is the final static box 76.Found it rele help ful. on 18 Nov 2008 at 11:58 am 79oasis hi! thanks for the tutorial…its very useful and easy to learn (^^)v thanks a lot to u 80.

015 b=40. but really i need hepl.015. 82. i hope you can help me. make the code 84. i am not familiar with GUI but i want to do some thing good. hope you can help me… i need to have the program….. and dir without changing every time the value in my program (like a littel software) thank you (this is just a part of a huge program) % TTRS(SU)= TTRS(3=A)====>TTRS(SP1USP2)= TTRS(KUJ) clear all close all tp20=0. %%%%%%%%%Surface de posage secondaire%%%%%%%%% alpha20p1 =tp20/a %alpha20p1= alpha de la phase 20 du posage primaire beta20p1 = tp20/b gamma20p1 = 0 u20p1 = 0 v20p1 = 0 w20p1 = tp20/2 %%%%%%%%%Surface de posage secondaire%%%%%%%%% alpha20p2 = 0 % alpha20p2 = alpha de la phase 20 du posage secondaire beta20p2 = tp20/a gamma20p2 = tp20/a u20p2 = tp20/2 v20p2 = 0 w20p2 = 0 %%%%%%%%%Surface usinée%%%%%%%%%%%%%%%%%%%%%%% alpha20u2 = 0 % alpha20u2 = alpha de la phase 20 de la surface usinée beta20u2max = tu20/a gamma20u2max = tu20/a u20u2max = tu20/2 26 of 69 10/26/2010 4:10 PM ... on 01 Dec 2008 at 6:09 am 81chetu Your tutorial is very helpful to me. subtract. on 10 Dec 2008 at 11:05 am 82jane i would like to ask help with my program. multiply and divide 2 numbers. on 14 Dec 2008 at 5:09 pm 84karim Sorry. tu20=0. i would like to make a GUI that will add. 81.com/matlab/matlab-gui-graphical-user-interface-tutorial. subtract. ok i have the fowlling program (sorry the note is in frensh) what i want is: how to built a GUI where i can have a zone where i can specify : tp. i am finishing my Phd and i have some Matlab program.. multiply and divide. display the result of each operation done. a=20.MATLAB GUI Tutorial . thank you. tu. maybe my problem is easy for some body but really i need help. on 10 Dec 2008 at 11:14 am 83jane i want to make a program that will add..For Beginners | blinkdagger http://blinkdagger. god bless 83.

v20p1.4.2). 0 0 gamma20u2max .'edgecolor’.0. xB = 0. gamma20p1 w20p1] DP1 = [u20p1.’FaceColor’. beta20p2 . beta20p2 v20p2+TP2M(1). w20p1] ROT1 = [alpha20p1 .'yel’.’k. gamma20p1] %%%%%%%%%%%%%%%%%%%Surface secondaire%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TP2 = [alpha20p2 u20p2. gamma20p2 w20p2+TP2M(1)] %%%%%%%%%%%%%%Somme des torseurs des posages%%%%%%%%%%%% TTRSposage = TP1 + TP2 %%%%%% Dans ce programme nous allons identifier la classe d’appartenance de 27 of 69 10/26/2010 4:10 PM . % patch(TTRS202(p. zB = 10. zA = 0.[1 2 3 1]). AB = [xB-xA.’FaceAlpha’. -u20u2max 0 0 .. yA = 10.com/matlab/matlab-gui-graphical-user-interface-tutorial.’).3).'gre’). beta20p1 .3).TTRS202(p. yB-yA. w20p2] ROT2 = [alpha20p2 . %%%%%%%%%%%%POLYTOPE DE L ERREUR DE L USINAGE % % plot3(TTRS202(:. v20u2 = 0 w20u2 = 0 TTRS202=[0 -beta20u2max 0. zB-zA] TP2M = cross(ROT2. beta20p2 v20p2.1).MATLAB GUI Tutorial ..TTRS202(p. % end % % grid on %%%%%%%%%%%%%%%%%%%%%%%%%Calcul vectoriel%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%Surface priamire%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% TP1 = [alpha20p1 u20p1. beta20p1 v20p1.TTRS202(:. gamma20p2 w20p2] DP2 = [u20p2.TTRS202(:. 0 beta20u2max 0. % hold on % for o = 1:size(C5.For Beginners | blinkdagger http://blinkdagger.AB) %%%%%%%%%%%surface secondaire vers le centre du primaire%%%%%%%% TP2 = [alpha20p2 u20p2+TP2M(1). yB = 10.1). 0 0 -gamma20u2max .2). u20u2max 0 0].1) % p = C5(o. % % xlabel(’bettaSU20′) % ylabel(’gammaSU20′) % Zlabel(’uSU20′) % title(’écart de la surface usinée de la phase20′) % % C5 = convhulln(TTRS202). gamma20p2] %%%%%%%%%%%%%distance vers le centre de la surface primaire%%%%%%%% xA = 20. v20p2.rand.

Ry =1. 0 0 -TTRSposage(3.com/matlab/matlab-gui-graphical-user-interface-tutorial.2)*1 v = TTRSposage(2. gamma w] TTRSpolyPosageMatrice =[0 -TTRSposage(2.colonne)) beta = TTRSposage(2..2)*1 w = TTRSposage(3..j) = TTRSposage(ligne.2) 0 0].2)*0 TTRSpolyPosage = [alpha u. beta=1.1)*0 gamma = TTRSposage(3.1)*0 u = TTRSposage(1.2)*0 w = TTRSposage(3.2)*0 w = TTRSposage(3.1)*1 gamma = TTRSposage(3.2)*0 v = TTRSposage(2.1)*0 %(TTRSposage(i.j) = TTRSposage(ligne.MATLAB GUI Tutorial .colonne)) beta = TTRSposage(2. u=1. gamma w] end end end %%%%%%%%%%%%%%%%%%%%% Dessin du polytope direction ‘x’ %%%%%%%%%%%%%%%%%% %%%%%%%%%%% 28 of 69 10/26/2010 4:10 PM . alpha=1.1)*1 u = TTRSposage(1. z = 1.j) = TTRSposage(ligne. TTRSposage(1. w=1.1)*1 %(TTRSposage(i.1)*1 %(TTRSposage(i.2)*0 v = TTRSposage(2.1) .2)*0 TTRSpolyPosage = [alpha u.1)*1 gamma = TTRSposage(3.1) 0. dir = x .1)*1 u = TTRSposage(1. 0 0 TTRSposage(3. % dir = direction. gamma=1. beta v.For Beginners | blinkdagger http://blinkdagger.2) 0 0.1) . gamma w] else if dir == z alpha = TTRSposage(1. Rz = 1. 0 TTRSposage(2. y = 1.colonne)) beta = TTRSposage(2. x = 1.1) 0. %%%%%%%%%%%%POLYTOPE DE L ERREUR DU MONTAGE % else if dir == y alpha = TTRSposage(1. beta v. v=1.2)*1 TTRSpolyPosage = [alpha u. Rx =1. dir dans le cas d’un plan est sa normale (”case à remplire”) % SDT = [alpha beta gamma u v w]‘. % TTRSposage = TTRS_PL : développement de SDT_PL (PL = plan) multiplication % par la normale de la surface tolérancée if dir == x alpha = TTRSposage(1. %%%%%% la surface ou du TTRS mis en jeux pour une pièce cubique et dont les %%%%%% opérations sont de simples surfaçages. beta v. -TTRSposage(1.

end end grid on 85.TTRSpolyPosageMatrice(m.MATLAB GUI Tutorial .TTRSpolyPosageMatrice(:.D20].2). % % xlabel(’betta20′) % ylabel(’gamma20′) % zlabel(’u20′) % title(’somme des variations usinage + posage’) % C6 = convhulln(D20).’facecolor’.1).1).rand.1).3).4 end grid on % view([90 0]) %%%%%%%%%%%%%%%%%%%%% Dessin du polytope direction ‘y’ %%%%%%%%%%%%%%%%%% %%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%Dessin du polytope direction ‘z’%%%%%%%%%%% %%%%%%%%%%%%%%Somme de la variation de l’usiange et du posage sur la %%%%%%%%%%%%%%surface usinée%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % figure DD20=[].1) l = C6(k.com/matlab/matlab-gui-graphical-user-interface-tutorial.:).D20(:.2).3). % plot3(D20(:.3).[1 2 3 1]).’).. D20 = TTRS202 + [TTRSpolyPosageMatrice(q. patch(D20(l. DD20=[DD20.TTRSpolyPosageMatrice(q.D20(:.’FaceAlpha’.0.1).TTRSpolyPosageMatrice(q.2).TTRSpolyPosageMatrice(q.TTRSpolyPosageMatrice(m.’).'red’).0.. xlabel(’betta’) ylabel(’gamma’) Zlabel(’u') title(’écart du système de posage de la phase20′) C4 = convhulln(TTRSpolyPosageMatrice). on 10 Jan 2009 at 12:39 am 87Anonymous 29 of 69 10/26/2010 4:10 PM .:).1).D20(l.’FaceAlpha’.:). hold on for k = 1:size(C6. on 23 Dec 2008 at 2:45 pm 86Reza It’s Excellent!! Thank you for useful tutorial 87. plot3(TTRSpolyPosageMatrice(:.For Beginners | blinkdagger http://blinkdagger.:). patch(TTRSpolyPosageMatrice(m. hold on for n = 1:size(C4.3).’k.2).[1 2 3 1]). on 16 Dec 2008 at 9:40 pm 85Len Thank you for the wonderful tutorial. Keep up the great work (I am referring to the website and your actual work) !!! 86.’g.D20(l.rand. for q=1:size(TTRS202.8.1) m = C4(n.TTRSpolyPosageMatrice(:.

i want to display a 3D model depending on the choice of the user. I am lost about how to write the code in the . using the pop-up menu in the GUI.file 92.file while executing the file? (What syntax/code to be used to ask user to input some numbers of certain parameter while running the program) 91.. Use get( ) to get the values in the edit box. However if i try to open the GUI directly from the . and press the green arrow to start it. prior to the code use get( ) just as it was described in this tutorial to get the values to be added. the pyramid model will be displayed. Thanks 89. and you can change parameters on the fly. @ Karim: Put your giant code in the button call back. I am lost about how to write the code in the .com/matlab/matlab-gui-graphical-user-interface-tutorial. if the user selects the model ‘pyramid’ from the pop-up menu.. on 10 Jan 2009 at 12:39 am 88Melian I really liked this tutorial !! Thank you !! I have a question. Typically it is ‘axes#’ or something of that sort. thanks 90. on 31 Jan 2009 at 8:03 pm 92Dan I used this tutorial to create my first GUI and it was extremely useful.m-file for this purpose.MATLAB GUI Tutorial .. open the file.fig file. i want to display a 3D model depending on the choice of the user. on 16 Jan 2009 at 4:03 am 90roslina Instead of asking user to change some numbers in the m. Just replace the button callback (currently a+b) with your m. using the pop-up menu in the GUI.file (the main program) before running the program. I really liked this tutorial !! Thank you !! I have a question. i appreciate any kind of help. I don’t know how to set the handles to do all of this. you need 3 edit boxes for your three parameters. And have them set to the variables in your m. I don’t know how to set the handles to do all of this. But I have a problem.For Beginners | blinkdagger http://blinkdagger. on 16 Jan 2009 at 12:26 pm 91Daniel Sutoyo @ Jane: Have you try the tutorial out yourself? The requests you have seem very doable on your own after completing the tutorial.axes1)… this tell MATLAB to display whatever plot function you use on that specific axis @ Rosalina: The two values to be added in the edit boxes are user submitted. i want to combine three . thankyou.file. You can check the tag name in GUI builder and double click on the axes. So you type in axes(handles. it gives me a bunch of errors when i press the ‘calculate’ button. For example.m-file for this purpose. Please help. Is this a common problem?? Or have I done something wrong most likely? 93. the pyramid model will be displayed. instead of two edit boxes. the pyramid model will be displayed.m file or can you teach me how to use GUI on this. can we use GUI command to change the numbers in the m. on 03 Feb 2009 at 9:11 am 93izzuddin 30 of 69 10/26/2010 4:10 PM . Thanks 88. Please help. I don’t know how to set the handles to do all of this” I am gonna assume you just need help to display. @ Melian: “pyramid’ from the pop-up menu. For example.m files into one . All you have to do is in your menu callback put in axes(’handles.name of your axes’). Everything works perfectly in my GUI after I type “GUIDE” in matlab. if the user selects the model ‘pyramid’ from the pop-up menu. on 13 Jan 2009 at 9:49 pm 89ley hi.

gui_State = struct('gui_Name'. All inputs are passed to time_response1_OpeningFcn via varargin. % % H = TIME_RESPONSE1 returns the handle to a new TIME_RESPONSE1 or the handle to % the existing singleton*...eventData. % UIWAIT makes time_response1 wait for user response (see UIRESUME) % uiwait(handles. GUIHANDLES % Copyright 2002-2003 The MathWorks. An % unrecognized property name or invalid value makes property application % stop.DO NOT EDIT % --. . % Update handles structure guidata(hObject.5 28-Jan-2009 13:56:14 % Begin initialization code .For Beginners | blinkdagger http://blinkdagger.please help me… function varargout = time_response1(varargin) % TIME_RESPONSE1 M-file for time_response1... 'gui_OutputFcn'. varargin{:}). eventdata. @time_response1_OutputFcn. GUIDATA.hObject. hi.for my first task i have to complete time response which include in the syllabus. ischar(varargin{1}) gui_State. 'gui_LayoutFcn'.i have to do learning kit for control systems.. % % See also: GUIDE. function time_response1_OpeningFcn(hObject..&amp. % % TIME_RESPONSE1('Property'. gui_Singleton. creates a new TIME_RESPONSE1 or raises the existing % singleton*. end % End initialization code .gui_Callback = str2func(varargin{1})..figure1). % hObject handle to figure % eventdata reserved . varargin{:}).output = hObject.i don’t know what is the coding for the transfer function. % % *See GUI Options on GUIDE's Tools menu.reply to my email asap. Starting from the left.. . handles.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to time_response1 (see VARARGIN) % Choose default command line output for time_response1 handles.) calls the local % function named CALLBACK in TIME_RESPONSE1.Executes just before time_response1 is made visible. ..) creates a new TIME_RESPONSE1 or raises the % existing singleton*. see OutputFcn. varargin) % This function has no output args.. handles..MATLAB GUI Tutorial .com/matlab/matlab-gui-graphical-user-interface-tutorial.handles.'Value'. []). false). .. by itself.. % Edit the above text to modify the response to help time_response1 % Last Modified by GUIDE v2. initialize_gui(hObject.time response contains step response and impulse response. 'gui_OpeningFcn'. end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State. [] . .. 31 of 69 10/26/2010 4:10 PM . 'gui_Singleton'. property value pairs are % applied to the GUI before time_response1_OpeningFunction gets called.. % % TIME_RESPONSE1('CALLBACK'. i need your help about my final year project. Choose "GUI allows only one % instance to run (singleton)"..fig % TIME_RESPONSE1.. @time_response1_OpeningFcn.. mfilename.DO NOT EDIT gui_Singleton = 1. else gui_mainfcn(gui_State. 'gui_Callback'.M with the given input arguments. if nargin &amp. handles). Inc.

isreset) % If the metricdata field is present and the reset flag is false.handles) % --. 32 of 69 10/26/2010 4:10 PM . end handles. %-------------------------------------------------------------------------% --.'String')).Executes on button press in plot_pushbutton1.metricdata.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles. 'metricdata') &amp.com/matlab/matlab-gui-graphical-user-interface-tutorial.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject.Outputs from this function are returned to the command line.to be defined in a future version of MATLAB % handles empty .'BackgroundColor'. handles) % hObject handle to reset_pushbutton2 (see GCBO) % eventdata reserved . after setting all properties. 'String'.a_input. end %-------------------------------------------------------------------------% --. % See ISPC and COMPUTER. end % Save the new value handles.metricdata. bail out as we dont want to reset the data. if isnan(a_input) set(hObject. isequal(get(hObject. eventdata.. 0). get(0. function plot_pushbutton1_Callback(hObject.&amp. guidata(hObject. ~isreset return. handles.a_input = a_input.'BackgroundColor'). errordlg('Input must be a number'.For Beginners | blinkdagger http://blinkdagger.'white').'defaultUicontrolBackgroundColor set(hObject.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get user input from GUI a_input = str2double(get(handles. handles. eventdata. % hObject handle to figure % eventdata reserved .output. handles) % hObject handle to plot_pushbutton1 (see GCBO) % eventdata reserved . it means % we are we are just re-initializing a GUI by calling it from the cmd line % while it is up. eventdata. handles) % varargout cell array for returning output args (see VARARGOUT).Executes on button press in reset_pushbutton2. if isfield(handles.handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. eventdata. handles) % hObject handle to a_input (see GCBO) % eventdata reserved . handles) % hObject handle to a_input (see GCBO) % eventdata reserved . eventdata. 'String')).Executes during object creation. if ispc &amp. function a_input_CreateFcn(hObject. function a_input_Callback(hObject.MATLAB GUI Tutorial .'String') returns contents of a_input as text % str2double(get(hObject. So. function reset_pushbutton2_Callback(hObject.a_input = 0. % --.&amp.'Error').to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) initialize_gui(gcbf. function initialize_gui(fig_handle. true).. function varargout = time_response1_OutputFcn(hObject.'String')) returns contents of a_input as a double a_input = str2double(get(hObject.

95. % -------------------------------------------------------------------function menu_Callback(hObject..to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) printdlg(handles. Right now structure of my GUI is: I have 5 variables to read so i hve 5 Static text and 5 edit text buttons. eventdata.data1=get(handles.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) file = uigetfile('*. 33 of 69 10/26/2010 4:10 PM . handles) % hObject handle to print (see GCBO) % eventdata reserved .... 'Yes'.figure1) 94. I need to read few variables through GUI mode of MATLAB. on 17 Feb 2009 at 1:41 pm 94Sagar I am graduate student at University of Cincinnati.fig').data1.'Name') '.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) selection = questdlg(['Close ' get(handles. handles) % hObject handle to menu (see GCBO) % eventdata reserved . I went through your tutorials and found them very useful for GUI design purposes.’string’) . end delete(handles.figure1. I have added 1 push button which says enter and in the callback of ENTER i have added these lines: output.MATLAB GUI Tutorial .a_input.'].com/matlab/matlab-gui-graphical-user-interface-tutorial.'Yes'). 'String'. end % -------------------------------------------------------------------function print_Callback(hObject.'Name') '?'].'No'. handles) % hObject handle to open (see GCBO) % eventdata reserved . I m having hard time in reading and storing variables.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % -------------------------------------------------------------------function open_Callback(hObject... 0) open(file). only because of this i was able to complete Adding GUI to my project… thanks…. if ~isequal(file. thanks a lot for u r tutorial… its awesome.m files which I have already developed..metricdata. if strcmp(selection.. eventdata.figure1) % -------------------------------------------------------------------function close_Callback(hObject.. ['Close ' get(handles. eventdata. set(handles.. handles. Could you please tell if this is right? and how can I store them? because I cant see the values which MATLAB reads in command line or so.figure1. store them and use them in other ..'No') return.. handles) % hObject handle to close (see GCBO) % eventdata reserved . on 18 Feb 2009 at 10:53 pm 95shayam hi sir. eventdata.For Beginners | blinkdagger http://blinkdagger.a_input).

Thanks ..com/matlab/matlab-gui-tutorial-a-brief-introduction-to-handles If you use the keyboard/breakpoint command then you can see whats going on inside your GUI by exploring the local workspace. Edit text box. All you have to put in your pushbutton callback is to use the function get() on the objects you need information from.how to move from one GUI to another GUI. 96.For Beginners | blinkdagger http://blinkdagger. on 05 Mar 2009 at 12:35 pm 99kartik great thread !!!!!!!!!! Can anybody help me. may be you can post a tutorial about creating stand alone application? most of what I found over the net isn’t so simple and hard to understand. and use this input when pressing the push button? Thank 98. radio button. Try this tutorial: http://blinkdagger. popup menu… you name it.com/matlab/matlab-gui-graphical-user-interface-tutorial. on 15 Mar 2009 at 12:08 pm 101Ahmad Jamil Thanks very much………… This tutorial helped me a lot by creating my first GUI file………………Thanks again 34 of 69 10/26/2010 4:10 PM . Quan 97. on 05 Mar 2009 at 3:59 pm 100Daniel @ Sebas yes you can! There are multiple ways in getting an input. waiting for replyy!!!!??? thank you 100.MATLAB GUI Tutorial .. on 27 Feb 2009 at 6:21 am 98Kuzya Thanks for the tutorial …. you also can replay to my e-mail address if it is convinient for you . by making use of push button. p.s. If you go to our MATLAB > basic GUI pages there are many examples of how this is done! @ Kuzya We will when we get some time! @ kartik In your button callback put in the following figurefilename(handles) handles if you want to pass data 101. on 20 Feb 2009 at 11:51 pm 96Quan Quach Sagar.Its like going from welcome screen gui to the operational gui. on 26 Feb 2009 at 5:48 am 97Sebas Hi! Thanks for this tutorial! But I do have a question: can you give input to an GUI. loved it . 99.

. lets say a and b. what should i do if i want to input 2 texts.m file as long as the inputs/outputs (aka arguments) match up.it dose only run with GUIDE BUILDER. on 28 Mar 2009 at 7:42 pm 108naxus hi. 103. on 23 Mar 2009 at 1:43 am 105Dimitrios Good tutorial! thank you verry much! 106.m stay in the same archive. on 24 Mar 2009 at 6:41 am 106moe hi im trying to load values from edit box to matlab workspace.com/matlab/matlab-gui-graphical-user-interface-tutorial.m to be in the same folder as your GUI files. thanks in advance. i was wondering if someone could help me with that. at the GUI? 109. and then display the result. 104.. i have a button tagged bisection in my gui. what i want is when i press this button the m-file bisection will execute. 105. on 29 Mar 2009 at 6:30 pm 109David Thanks for being so selfless and posting this knowledge on the web for everyone to access. but if it’s not. How can i call an m-file which i have created in the editor using the gui. on 18 Mar 2009 at 12:19 am 102Jorge Becerra I have this error: >> Calc_DistanciaRadTierraVr1Test1 ??? Undefined function or variable “designEval”. pls. 102. Error in ==> gui_mainfcn at 97 if designEval && ishandle(fig) Error in ==> Calc_DistanciaRadTierraVr1Test1 at 42 gui_mainfcn(gui_State. This requires process. on 30 Mar 2009 at 7:16 am 110Zane Montgomery Naxus. Look into a static text box. varargin{:}). on 24 Mar 2009 at 1:53 pm 107hazeem thaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanks 108. on 19 Mar 2009 at 3:49 am 103philip i have a problem with my gui file. this is a project of mine in school. lets say process. disp(c) % or whatever display code you may want.b). give me a solutin for this. for example. on 21 Mar 2009 at 12:58 am 104wena hi! I am having a problem creating my project.For Beginners | blinkdagger http://blinkdagger. My both files . 107.fig and .m. lets say c. You shouldn’t have an issue calling the function ‘process.. please help.MATLAB GUI Tutorial . In your GUI you would want to have something like this: c = process(a. you can use the addpath feature which is talked about here: 35 of 69 10/26/2010 4:10 PM . help me. 110. and then process them in a separate m-file.m’ in your GUI .

com/?s=addpath#4 good luck. Zane 111. on 15 Apr 2009 at 8:53 am 117Zane Montgomery 36 of 69 10/26/2010 4:10 PM .For Beginners | blinkdagger http://blinkdagger. The these tutorials should be able to help you out with plotting the data: http://blinkdagger. on 01 Apr 2009 at 2:02 am 112k8 Thank you very much!!! 113.AxisName.MATLAB GUI Tutorial .. on 30 Mar 2009 at 9:38 pm 111Offi Hey! Thanks for the tutorials on your site.. on 14 Apr 2009 at 7:50 am 115moe hi i have to use a check box to give the user the option to hold the graph that has been plotted by a push button. http://blinkdagger.com/matlab/matlab-gui-tutorial-plotting-data-axes The key code you’ll be needing will be something like this: For your checkbox callback function if(get(hObject. on 14 Apr 2009 at 8:54 am 116Zane Montgomery Moe. They’re really helpful! I got a problem with the edit text though. can someone please help me how i can programm the check box? thanks in advance 116. The problem is that the ‘String’ value of the edit field isn’t updated after the keystroke but only after the callback i think although the pressed key already shows up in the GUI itself. Zane! i’ll try doing that 114.com/matlab/matlab-gui-graphical-user-interface-tutorial. Zane 117. thank u very much for this one. Does anyone know how to force MATLAB to update the ‘String’ value or is there another value that actually represents the string shown in the edit text? 112. on 11 Apr 2009 at 8:21 am 114vinod this is a very good tutorial . ‘on’) I’ll leave it to you to play around with this. on 08 Apr 2009 at 12:28 am 113naxus thanks. 115. HTH. I was trying to check the string inside the edit field after every keystroke so i used the KeypressFcn.'Value'))==1 %Checked box has 'Value' of 1 hold on else hold off end % hold prevents the current axes from being overwritten when you plot a new graph to hold a specific axes if you have multiples use: hold(handles.

c = num2str(total). can someone please help me? thanks very much in advance 123. if (c &lt. on 16 Apr 2009 at 12:15 pm 121Dianna Hey.com/videos/ ). on 16 Apr 2009 at 1:29 am 119Vander Thanks! 120. So it won’t update after every keystroke. end 121.For Beginners | blinkdagger http://blinkdagger. I just got it to work. or change focus in the GUI”. Do I use the code ‘if’? total = str2num(a) + str2num(b).com/matlab/matlab-gui-graphical-user-interface-tutorial. So never mind my question 122. on 15 Apr 2009 at 9:01 am 118moe thank you very much Zane 119. on 26 Apr 2009 at 10:48 am 124lakshman hia thanks for tutorial can you show me a simple example of signal i mean if we want to create sine wave how we do that 125. Good luck. but it’s outside of my abilities. on 16 Apr 2009 at 11:42 am 120Dianna Hi again. The conclusion was that “unfortunately. Zane 118. @ Offi. else c = num2str(total). 0) %c is the answer for the calculation c = 0.MATLAB GUI Tutorial . I talked with Doug at MathWorks ( http://blogs. the change in the edit box string does not really register in MATLAB until you hit enter. Is it possible to ’set’ the answer? Suppose I don’t want the answer to the a negative number. on 28 Apr 2009 at 4:52 am 125Toon 37 of 69 10/26/2010 4:10 PM .. I want the static text of the answer to be automatically be 0. on 21 Apr 2009 at 8:37 pm 123Offi Thanks a lot Zane! It’s really great of you guys not just to give those great and easy to understand tutorials but also provide help with problems! 124.mathworks. If the answer is going to be negative.. the task is to modify and replace the new parameter with the existing one in the work space. on 17 Apr 2009 at 7:33 am 122moe Hi i have a situation that i have a GUI with some edit text box that each box views a parameter from the work space. You might be able to embed ActiveX or Java controls if you really need this to happen.

. thank you for your effort.For Beginners | blinkdagger http://blinkdagger. Also.m).. IT IS FUCKING USEFULL! thx:) 126.m editor i can click on “Edit configurations for file. Its like the . 38 of 69 10/26/2010 4:10 PM . Good luck Zane 128. {. “get” and “num2str” didnt turn blue like shown.m Line: 126 Column: 12 Expression or statement is incorrect–possibly unbalanced (. they stop working I cant find the configuration to actually seperate projects from each other and how to re-link m-file with the fig-file 129. i have a “beginner” problem with matlab R2007b. Whenever I create a GUI and save it in a folder somewhere (doesnt matter). you can reach it by clicking the small arrow down next to it) In there i see a lot of files that are actually other projects and have nothing to do with this current file. or [. then I create a 2nd GUI. This is in contrast is an excellent tutorial. on 13 May 2009 at 11:30 am 129mmb4good thanks alot 130. I got this error message. But then when I re-open the 1st GUI.m is not found in the current directory or on the mathlab path. I usually pick add to path. on 12 May 2009 at 9:04 am 128eastmus Hi Zane again and hi to all. In the file. peace. 127. Can you tell me whats wrong? >> MyAdder ??? Error: File: MyAdder. on 07 May 2009 at 1:04 am 126Anonymous I tried this demo. add to path or cancel/help.. not everything matches up perfectly.com/matlab/matlab-gui-graphical-user-interface-tutorial. Check out your line 126 (or post it here) and make sure you’ve closed every bracket you open and don’t have any loose ones floating around. on 14 May 2009 at 1:50 am 130Berkan The official MatLab GUIDE video does not explain the most important bit: callback functions at the backend. It’s mainly just a visual aide when explaining the code.m” (its located under the green RUN arrow button.fig are not linked anymore. but It wouldnt work. MATLAB is very specific about opening and closing brackets/parentheses/etc. Don’t worry about the coloring you see from the site. So I delete the others.m and . I also often get the window popup saying “File C:\….\file.MATLAB GUI Tutorial . Also when I move files. it gives errors that it cant find the variables from the script file (.” with the options to change dir. on 07 May 2009 at 7:02 am 127Zane Montgomery Anon. totally different name and files and I have even tried saving in same folder or a different folder from the 1st GUI.

on 21 May 2009 at 11:18 pm 136Praveen Dear sir.g if output of the first push button is “a” and out put of second push button is “b” then i want to call both thses outputs in pushbutton three to do c=a+b.. e. 137. This tutorial helped me a lot……. 136. How can i use the output function? Thanks a lot 132.i guess 134. thank you for making the impossible (for me) possible.MATLAB GUI Tutorial . on 16 May 2009 at 2:56 pm 132Anudhan Thank you. I have a problem I can not save a variable inside my GUI I use a GUI to get an equation for me and save it as a variable but it only prints the answer on Matlab command window on push button press. thanks for all.com/matlab/matlab-gui-graphical-user-interface-tutorial. on 18 May 2009 at 2:55 am 133inu waaaaaah………. what a great innovation!!!!!!!!!! u know saracasm…. i will study all the other tutorials thanks 138.For Beginners | blinkdagger http://blinkdagger. on 21 May 2009 at 2:17 pm 135Doğuş Metin these are really very good examples for people new on matlab gui. 133.. on 23 May 2009 at 6:49 am 137zak hi you can’t believe how much i was happy when i have run the first matlab GUI... Berkan 131. Thank you very much for this simple and useful tutorial on GUI in matlab. and then store to another static text kindly answer ASAP how to do this? 135. on 15 May 2009 at 10:14 pm 131Payam Hi thank you for your wonderful site. on 19 May 2009 at 7:08 pm 134usman I have used three push buttons in my GUI now i want to use the output results of the two push buttons dat goes to a static text box to be called in the third pushbutton call back as input. expecting more tutorials like this. on 28 May 2009 at 5:35 pm 138Bilal Hussain Thankyou brother 39 of 69 10/26/2010 4:10 PM . When i put my command on output function it dows not get any equation it shows zero only. its possible to understand easily.

An e-mail response would be greatly appreciated. ama ben yargısız infaz [. and need to be converted to variables of Number type before they can be added together total = factorial(str2num(a)) %CHANGE IS HERE. on 10 Jun 2009 at 12:31 am 142asder don Zane.c).'String'). on 03 Jun 2009 at 3:12 am 139Güncel ve Günlük Blog! | JunkChorn » Hocam Sesimi Duyuyor Musun? #3 [. I went through the mail chain. Thank you...com/matlab/matlab-gui-graphical-user-interface-tutorial.001 as the answer regardless of what I put in. Thanks 141.input2_editText. on 10 Jun 2009 at 1:10 am 143asder don I just got it! The command is apparently. a and b are variables of Strings type. however. To get a grasp on the strings and tags. save for the push button which is tagged “factorize_pushbutton1″ http://img188. on 09 Jun 2009 at 3:46 am 140asder don Great tutorial. not to mention the whole coding of the . guidata(hObject. 143.'String'. This is pretty much what I did. total = gamma (str2num (a) + 1). Here is a screenshot of what I have.I am a student(masters). thank you.. except I emitted b since I only have one edit text.input1_editText. I get something similar to 175.. on 09 Jun 2009 at 3:36 pm 141Zane Montgomery @ asder. What do I have to do differently to make the push button take the factorial of the variable? The tags and strings are a bit confusing. but notice the changes: a b % % = get(handles.imageshack. It doesn’t seem to work. Let us know if you have specific questions. The strings and tags are the same. on 10 Jun 2009 at 1:17 am 144dileep d Dear friends.MATLAB GUI Tutorial . the main part you will want to edit is Step 4 of the “Writing the Code for the GUI Callbacks” section. -Zane 142. Buyrun. handles). 144. Find the section that looks similar to what I have below. = get(handles. I still have some questions though. 139. I recommend following each step in the tutorial and ask questions on specific parts if they arise. % need to convert the answer back into String type to display it set(handles. 40 of 69 10/26/2010 4:10 PM .] Ebrar denen şahsiyet ile hiç işim olmaz. Bunun arkadan konuşmak olduğunu düşünüyor da olabilirsiniz.png Again.. To display the factorial of some input number.For Beginners | blinkdagger http://blinkdagger. b is now ignored completely c = num2str(total)..] 140.'String'). i want to take input form a hardware device(particularly ultrasound probe) in real time and plot the input data in real time.us/img188/2361/54570432. ödevdeki butonlara görev atamayı anlatan çok güzel bir blog.answer_staticText.m file afterward.

. DIleep. Regards. on 10 Jun 2009 at 9:07 am 147Anonymous ?? Reference to non-existent field ‘input1_editText’. but i request if some body know it to help me to do this. Error in ==> MAGUI at 42 gui_mainfcn(gui_State. Error in ==> MAGUI>add_pushbutton_Callback at 150 a = get(handles. I went through the mail chain.I am a student(masters). Error in ==> MAGUI at 42 gui_mainfcn(gui_State. since i am new to matlab.input1_editText. since i am new to matlab.eventdata)MAGUI(’add_pushbutton_Callback’. some matlab experts out here can help me.. on 10 Jun 2009 at 1:17 am 145dileep d Dear friends. 41 of 69 10/26/2010 4:10 PM .eventdata. email id:dil639@yahoo.hObject. I dont have any idea if this can be done in matlab or not. on 10 Jun 2009 at 9:00 am 146Anonymous I DID’NT GET ANSWERE FOR ANY VALUES THE ANSWERBOX SHOWS 0 ONLY WHY 147. after this i want to develope a gui for this.com 145. Error in ==> MAGUI>add_pushbutton_Callback at 150 a = get(handles. Error in ==> gui_mainfcn at 96 feval(varargin{:}).’String’). but i request if some body know it to help me to do this.MATLAB GUI Tutorial . i want to take input form a hardware device(particularly ultrasound probe) in real time and plot the input data in real time. email id:dil639@yahoo. varargin{:}).input1_editText. Error in ==> guidemfile>@(hObject. I dont have any idea if this can be done in matlab or not. on 10 Jun 2009 at 9:08 am 148Anonymous ?? Reference to non-existent field ‘input1_editText’. Error in ==> gui_mainfcn at 96 feval(varargin{:}).com/matlab/matlab-gui-graphical-user-interface-tutorial. Regards.For Beginners | blinkdagger http://blinkdagger.com 146. DIleep.guidata(hObject)) ??? Error while evaluating uicontrol Callback 148. some matlab experts out here can help me.’String’). varargin{:}).

I just started working about a month ago. you guys do amazing work and you’ve really helped me out! I’m suprised that I’m actually excited about MATLAB now. My MATLAB skills aren’t the greatest. Error in ==> guidemfile>@(hObject.means when i click a buton in GUI. how to open a . on 11 Jun 2009 at 5:41 am 149lakshman ?? Reference to non-existent field ‘input1_editText’. So naturally.guidata(hObject)) ??? Error while evaluating uicontrol Callback I GOT ABOVE ERROR WHAT CAN I DO 149.really help me a lot… but i’ve got one question and need your favour/help….eventdata. Error in ==> MAGUI>add_pushbutton_Callback at 150 a = get(handles.For Beginners | blinkdagger http://blinkdagger.eventdata)MAGUI(’add_pushbutton_Callback’.guidata(hObject)) ??? Error while evaluating uicontrol Callback what is the mistake 150. Error in ==> gui_mainfcn at 96 feval(varargin{:}). I turned to the internet for help. on 18 Jun 2009 at 10:52 am 150Quan.txt file and display it on the static text…. Excellent tutorial….. how to clear text field 153. and I didn’t know MATLAB could make GUIs before then. I was too scared to tell my boss that I’m useless..txt file which consist of numbers and words/text… 42 of 69 10/26/2010 4:10 PM . on 13 Jul 2009 at 6:39 pm 153siti how to make a GUI when i click the pushbutton on “start” it can control the scanner interface. Error in ==> guidemfile>@(hObject. Thanks again.’String’). My boss wanted me to GUIs with MATLAB (as well as other MATLAB related tasks).com/matlab/matlab-gui-graphical-user-interface-tutorial. on 19 Jun 2009 at 4:42 am 151shalomi Thank you! very helpful and clear tutorial... you're my GUI hero Hi Quan.input1_editText.hObject. on 20 Jul 2009 at 1:36 pm 154Meteja Hi there…. I’m a senior in college. Thanks! I was wondering if you’d perhaps do a tutorial on Active X controls someday…. scanner interface will comeout. varargin{:}). I’m so glad I found your site! I’ve read all of your GUI posts and almost every other blinkdagger post (you guys just make it interesting). on 19 Jun 2009 at 10:02 pm 152usha this code great help to me. Error in ==> MAGUI at 42 gui_mainfcn(gui_State.hObject. Joe 151.MATLAB GUI Tutorial . i run add program..eventdata)MAGUI(’add_pushbutton_Callback’. 152.eventdata.how to make it happen? 154. Thank you! My job is safe because of blinkdagger (Quan in particular)! Again.for example let say readme. and I needed a job during the summer.

on 29 Jul 2009 at 5:01 am 158lakshman hai thanks for ur model. matlab draws attention with an error... and sorry for my bad english! 43 of 69 10/26/2010 4:10 PM . Thanks 155.MATLAB GUI Tutorial . but you can type in an input and then either: click away from the box. so without use global. on 05 Aug 2009 at 2:20 am 160lak hai thanks for ur model.thank u all. in another GUI function. or hit ‘enter’ and have them update. on 29 Jul 2009 at 9:29 pm 159Amgalan Hi? I made one interface in Matlab. To do this.com/matlab/matlab-gui-graphical-user-interface-tutorial. and i’m trying to make a GUI. So that I want to know “How to apply TAB strip in Marlab? ” Is there anyone help me? 160.. matlab doesn’t give me any errors!! For examples. i like your myadder gui. It’a very helpful!!!!! 156. but i want it so as the user types in the inputs it automatically updates the answer box without using a pushbutton. if we want take some text as input and the value of text is declared in workspace how? 161. When I use ‘global’ in a function to call a variable defined in an other GUI function. global intermedio. Is that possible? Thanks 157. on 12 Aug 2009 at 12:20 am 161Chiara Hi. But I wanna to rearrange that GUI. on 26 Jul 2009 at 8:59 am 157Zane Montgomery Astromoof. If I define the variable in the first function. Good luck! -Zane 158. I=im2double(intermedio). i haven’t bugs! Is there anyone help me?. where the variable ‘intermedio’ is defined above. just put the code for you pushbuttoncallback into the callback function for the edit text box. i’m an italian student. It is not possible to have the inputs update while you’re typing. But if i define ‘intermedio’ in this function. on 22 Jul 2009 at 1:52 am 155Dhila Othman Thank for all the guidelines…. Matlab gives me an error. that is running now.For Beginners | blinkdagger http://blinkdagger. but i’ve a problem. if we want take some text as input and the value of text is declared in workspace how? 159. on 23 Jul 2009 at 3:49 pm 156Astromoof Hi.

165.MATLAB GUI Tutorial . on 10 Sep 2009 at 8:57 am 169mark Please can someone asnwer me?. Error in ==&gt. Error in ==&gt..calc_button_Callback at 450 total= str2num(a) + str2num(b) + str2num(c) + str2num(d) + str2num(e) + str2num(f) + str2num(g) + str2num(h) + str2num(i).@(hObject. varargin{:}). str2num at 33 Requires string or character array input. int or char) should I use if I just want to convert input 44 of 69 10/26/2010 4:10 PM .thank you very much.it’s possible to use GUI to create a moving point or something like a 2D randon walker? Many thanks 170.g. 162. on 08 Sep 2009 at 8:18 am 167Herman It’s very powerful! Many thanks for your tutorial…Makes more open my eyes about powerful of matlab.For Beginners | blinkdagger http://blinkdagger. 168. however Matlab complains that input should be done in an array.eventdata)GUIMagnetfalt('calc_button_Callback'. on 24 Sep 2009 at 12:38 am 171CB ??? Error using ==&gt.com/matlab/matlab-gui-graphical-user-interface-tutorial. on 28 Aug 2009 at 10:59 pm 165daba Thanks 166.eventdata. on 10 Sep 2009 at 11:46 pm 170mirza mirza gango hy 171. on 22 Aug 2009 at 12:19 am 163Zor Excellent tut Thanx for the effort! 164. GUIMagnetfalt at 42 gui_mainfcn(gui_State. double. on 09 Sep 2009 at 8:50 pm 168ruchita how to add a circuit diagram in a gui figure 169. Error in ==&gt. GUIMagnetfalt&gt.. on 15 Aug 2009 at 6:52 am 162dbsjro Man this is REALLY helpfull You should be as ->help Quan Quach <lol 163. guidemfile&gt. Error in ==&gt. on 01 Sep 2009 at 10:55 am 166mark it’s possible to use GUI to create a moving point or something like a 2D randon walker? Many thanks 167.guidata( ??? Error while evaluating uicontrol Callback I try to add the numbers. num. What may be the problem? Is num supposed to be in an array? What type (e.. gui_mainfcn at 96 feval(varargin{:}). on 22 Aug 2009 at 7:05 am 164vinodh hi this website is very very useful.hObject.

0). d. what code shall i include. like me! I sincerely appreciate your job. h. the creation date for the file will show up at the fifth line of the output createDate = direc(dateloc:(dateloc+21)). 179. on 22 Oct 2009 at 9:00 pm 177Berlyn how can i downlaod matlab? 178. the example is simple and clear for beginners. on 06 Nov 2009 at 9:53 am 178piyush Please tell me. This website is awesome and very useful for anyone who studies MATLAB. % Obtain the directory listing of the file on the operating system newlines = find(double(direc) == 10). if I want a close push button and perform a simple GUI close.-) but i need some one who can help me out in coming out with a loop like a for loop and all using MATLAB …. m.so if anyone can help me…. 175.s] = datevec(createDate). mn. on 21 Oct 2009 at 4:56 am 176selva thank you sir great tutorial. on 01 Oct 2009 at 11:38 pm 173minjae Hi.. h.12.m’). % Check for newline characters in the returned string dateloc = newlines(5)+1. After reading your tutorials the mist has parted.26. UserFiledate = datenum(y.MATLAB GUI Tutorial . string and add them together? 172.09.thx for the tutorial 177. on 18 Oct 2009 at 7:09 am 175Gustav Thanks. % In DOS.com/matlab/matlab-gui-graphical-user-interface-tutorial. m. on 26 Sep 2009 at 12:00 am 172Niketan changes made by niketan type this at matlab command to check whether specify file is original or copied your current dir want to be directory.pls do kindly mail me at megal8725@hotmail.s). if (UserFiledate > OriginalFileDate) % Check if the createDate for the file is later that a specific time disp(’Copied File’) else disp(’Original File’) end 173. 176.. mn. Thank you! 174. OriginalFileDate = datenum(2009. where your specifed file is. thanks a lot 45 of 69 10/26/2010 4:10 PM .13. on 10 Nov 2009 at 11:44 pm 179Megalla hi there…thanks 4 the perfect tutorial….it was a very easy-to-understand tutorial….com…i dont mind paying u’ll…. ———————— [a direc] = dos(’dir Target_Detection.For Beginners | blinkdagger http://blinkdagger. As a newbie to MATLAB I was going nutty reading help files and the Mathworks website. d. % Retrieve the creation date in a string [y. I’m a university student in Korea. on 09 Oct 2009 at 5:53 pm 174Craig Thanks SO much for this website.

For Beginners | blinkdagger http://blinkdagger. % 46 of 69 10/26/2010 4:10 PM . 184. on 30 Nov 2009 at 9:47 pm 185valerie hi May i know how to view a web cam inside the GUI interface? Thanks valerie 186. Your syntax of ‘2e-25′ should work as an input. keep it up.. below is piece of my code. the problem i’m facing is that i’m writting a program that enables a user to enter values into the gui like the start time and stop and then click a button that will then plot either a sine wave or unit step function depending on the button pressed. on 16 Nov 2009 at 7:16 am 181momena thanks a lot dear…. Cheers 185. on 14 Nov 2009 at 12:50 pm 180Gav Very helpfull introduction.i actually knew nothing about creating GUI…. function varargout = untitled(varargin) % UNTITLED M-file for untitled. by itself.. i’d like to input number 2e-25 . Let us know if you get any errors using that or if you have a specific usage question. I have tried to follow your tutorials and incoperate the different functionalities but it not working. 180. on 29 Nov 2009 at 7:09 pm 184Satvik Hey .com/matlab/matlab-gui-graphical-user-interface-tutorial.but now i can make one 182. Does anyone please know how to make an input using ‘e’? For example. pliz help me figure out the problem.fig % UNTITLED.MATLAB GUI Tutorial . % % H = UNTITLED returns the handle to a new UNTITLED or the handle to % the existing singleton*. on 17 Nov 2009 at 2:36 pm 182Zox Hello everyone. on 01 Dec 2009 at 6:15 pm 186Sammy hi Firstly thx for your tutorials.and surely i would like to avoid typing the whole number with this many decimals! Is there any chance that i could do this in more elegant way? Thanx a lot! 183. on 17 Nov 2009 at 3:55 pm 183Zane Montgomery Zox. Great Tutorial I was wondering if you could add to the “gcf” part of a designing a GUI. Really helpful for beginners like me. creates a new UNTITLED or raises the existing % singleton*. thanks again. 181.

For Beginners | blinkdagger http://blinkdagger.DO NOT EDIT gui_Singleton = 1. property value pairs are % applied to the GUI before untitled_OpeningFcn gets called. % % UNTITLED('Property'. [] . function varargout = untitled_OutputFcn(hObject.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to untitled (see VARARGIN) % Choose default command line output for untitled handles. varargin{:}). eventdata. GUIHANDLES % Edit the above text to modify the response to help untitled % Last Modified by GUIDE v2.figure1)..&amp. eventdata. 'gui_LayoutFcn'.output.. varargin) % This function has no output args. . % Update handles structure guidata(hObject. mfilename. function untitled_OpeningFcn(hObject. else gui_mainfcn(gui_State.) creates a new UNTITLED or raises the % existing singleton*. end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State. handles). varargin{:}).. 'gui_Callback'.. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %DO NOT ALTER THE CODE ABOVE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function Start_editText_Callback(hObject. end % End initialization code . . handles) % hObject handle to Start_editText (see GCBO) % eventdata reserved . Starting from the left. 'gui_OutputFcn'.hObject. Choose "GUI allows only one % instance to run (singleton)".to be defined in a future version of MATLAB 47 of 69 10/26/2010 4:10 PM . % UIWAIT makes untitled wait for user response (see UIRESUME) % uiwait(handles. % % *See GUI Options on GUIDE's Tools menu. % --. ischar(varargin{1}) gui_State. gui_State = struct('gui_Name'. . % UNTITLED('CALLBACK'.. 'gui_OpeningFcn'... % hObject handle to figure % eventdata reserved .... @untitled_OutputFcn.DO NOT EDIT % --.output = hObject.Outputs from this function are returned to the command line..) calls the local % function named CALLBACK in UNTITLED. eventdata.Executes just before untitled is made visible. @untitled_OpeningFcn. handles) % varargout cell array for returning output args (see VARARGOUT).gui_Callback = str2func(varargin{1}). [])... All inputs are passed to untitled_OpeningFcn via varargin. gui_Singleton.5 02-Dec-2009 00:31:13 % Begin initialization code ..to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles. see OutputFcn. .com/matlab/matlab-gui-graphical-user-interface-tutorial. if nargin &amp. % % See also: GUIDE. % hObject handle to figure % eventdata reserved .handles. An % unrecognized property name or invalid value makes property application % stop....M with the given input arguments. . handles. 'gui_Singleton'..eventData. GUIDATA.'Value'.MATLAB GUI Tutorial .

% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject.&amp. eventdata.. guidata(hObject. handles). eventdata. guidata(hObject. function Start_editText_CreateFcn(hObject.'BackgroundColor'.'String')). isequal(get(hObject.'BackgroundColor').'String')). after setting all properties.handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.'white').to be defined in a future version of MATLAB % handles empty .'String')).handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.'String') returns contents of Start_editText as text % str2double(get(hObject. get(0.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) 48 of 69 10/26/2010 4:10 PM . if ispc &amp. handles) % hObject handle to Step_editText (see GCBO) % eventdata reserved . get(0. handles). % See ISPC and COMPUTER.Executes during object creation. guidata(hObject. eventdata.'defaultUicontrolBackgroundColor set(hObject.'white'). end function Stop_editText_Callback(hObject. function Step_editText_CreateFcn(hObject.'BackgroundColor').'String')) returns contents of Start_editText as a double input = str2double(get(hObject. get(0.MATLAB GUI Tutorial . % --.&amp. after setting all properties.to be defined in a future version of MATLAB % handles empty . handles) % hObject handle to Start_editText (see GCBO) % eventdata reserved . after setting all properties.Executes during object creation. % --.For Beginners | blinkdagger http://blinkdagger.Executes during object creation.to be defined in a future version of MATLAB % handles empty . end function Frequency_editText_Callback(hObject. if ispc &amp.com/matlab/matlab-gui-graphical-user-interface-tutorial. % See ISPC and COMPUTER.handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. end function Step_editText_Callback(hObject.&amp.'BackgroundColor'.'String') returns contents of Stop_editText as text % str2double(get(hObject. isequal(get(hObject. handles) % hObject handle to Frequency_editText (see GCBO) % eventdata reserved . eventdata. handles).'String')) returns contents of Stop_editText as a double input = str2doudle(get(hObject. if ispc &amp..'white'). isequal(get(hObject. handles) % hObject handle to Stop_editText (see GCBO) % eventdata reserved .'String') returns contents of Step_editText as text % str2double(get(hObject. handles) % hObject handle to Step_editText (see GCBO) % eventdata reserved . function Stop_editText_CreateFcn(hObject.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject.'BackgroundColor'.'String')) returns contents of Step_editText as a double input = str2double(get(hObject.'BackgroundColor').'defaultUicontrolBackgroundColor set(hObject. % --. % See ISPC and COMPUTER. eventdata.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject. eventdata. handles) % hObject handle to Stop_editText (see GCBO) % eventdata reserved .'defaultUicontrolBackgroundColor set(hObject.

to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) start_time =get(handles. stop_time = get(handles. stop_time = get(handles. fundamental_frequency = get(handles.'String').'String')). function Sine_pushbutton_Callback(hObject. guidata(hObject.MATLAB GUI Tutorial .Executes during object creation.axes1) t = [ 0 start_time step_time stop_time ] %defining the X-axis m = [ 0 0 1 1] %defining the Y-axis plot ( t. handles) % hObject handle to Sine_pushbutton (see GCBO) % eventdata reserved . function Impulse_pushbutton_Callback(hObject.'String').'String') returns contents of Frequency_editText as text % str2double(get(hObject.to be defined in a future version of MATLAB % handles empty . function Step_pushbutton_Callback(hObject. handles)..'String').stop_editText.frequency_editText. axes(handles. axes(handles. after setting all properties.handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.com/matlab/matlab-gui-graphical-user-interface-tutorial. eventdata. % --.stop_editText.m ) %plots the graph of all the lines %defined by 't' versus 'm' grid on %adds main grid lines to the current axes xlabel ('time') %labels the x-axis of the current axes ylabel ('magnitude') %labels the y-axis of the current axes title ('plot of unit step function of user defined duration')%adds title to the current axes guidata(hObject.'white').&amp.'String').'String').start_editText. get(0. % Hints: get(hObject.Executes on button press in Impulse_pushbutton.'BackgroundColor').Executes on button press in Sine_pushbutton.axes1) t = [ 0 start_time step_time step_time step_time stop_time ] m = [ 0 0 0 1 0 0 ] plot ( t.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) start_time = get(handles.stop_editText. eventdata. eventdata. end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %CODE ABOVE FOR EDIT TEXT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % --.'BackgroundColor'.'String'). handles) % hObject handle to Step_pushbutton (see GCBO) % eventdata reserved .axes1) 49 of 69 10/26/2010 4:10 PM . eventdata. handles).. %updates the handles % --.Executes on button press in Step_pushbutton.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) start_time = get(handles. %updates the handles %defining the x-axis %defining the y-axis %plots the graph of a %adds main grid to th %labels the x axis %labels the y axis %adds title to curren % --.m ) grid on xlabel ('time') ylabel ('magnitude') title ('plot of unit impulse function of user defined duration') guidata(hObject. step_time = get(handles. handles) % hObject handle to Frequency_editText (see GCBO) % eventdata reserved .'String').'String'). stop_time = get(handles.start_editText.'String').'String')) returns contents of Frequency_editText as a double input = str2double(get(hObject.start_editText.step_editText. if ispc &amp. handles).step_editText. axes(handles. function Frequency_editText_CreateFcn(hObject.For Beginners | blinkdagger http://blinkdagger. handles) % hObject handle to Impulse_pushbutton (see GCBO) % eventdata reserved .'defaultUicontrolBackgroundColor set(hObject. step_time = get(handles. isequal(get(hObject. % See ISPC and COMPUTER.

'String'). grid on %defines the time base functi %generates a sine wave with s %time base function 'time' an %plots the graph of all the lines %defined by time versus sin(x %and adds main grid lines to xlabel ('Time') %labels the x axis ylabel ('Frequency') %labels the y axis title ('plot of sine wave of user defined frequency and duration') %adds a title to the graph guidata(hObject.stop_editText.01:stop_time.. on 03 Dec 2009 at 9:07 am 188shiv Sir i want to extract the RGB value of the part of the image selected by user but the gui contains many button and this image on single GUI(frame) 189. time = start_time:0.axes1) time = start_time:0.For Beginners | blinkdagger http://blinkdagger.frequency and width %plots the graph of all t %defined by time versus ( %and adds main grid lines xlabel ('Time') %labels the x axis ylabel ('Frequency') %labels the y axis title ('plot of square wave of unit magnitude over user defined period')%adds a title to the grap guidata(hObject.even using the source code directly invokes the same error: ??? Error while evaluating uicontrol Callback ??? Attempt to reference field of non-structure array. fundamental_frequency = get(handles. on 08 Dec 2009 at 8:49 am 191S. x = sawtooth(time*fundamental_frequency*2*pi.x). grid on %defines the time base fu %generates a sawtooth wav %time. axes(handles..Executes on button press in Sawtooth_pushbutton. 50 of 69 10/26/2010 4:10 PM .(x)). x = sin(time*fundamental_frequency*2*pi) plot(time.start_editText.'String').01:stop_time.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) start_time = get(handles. %updates the handles 187. on 06 Dec 2009 at 8:57 pm 190uDjo thx for the tutorial 191.'String'). width) plot(time.M Negranol Having some serious trouble with this one . stop_time = get(handles.frequency_editText. handles). handles) % hObject handle to Sawtooth_pushbutton (see GCBO) % eventdata reserved . eventdata. on 03 Dec 2009 at 9:05 am 187shiv hello sir can u tell me how can i do this on the single Gui i want 2 image along with 2 buttons after clicking the button the image should be open in small part of GUI 188.MATLAB GUI Tutorial .com/matlab/matlab-gui-graphical-user-interface-tutorial. %updates the handles % --. handles). function Sawtooth_pushbutton_Callback(hObject. on 04 Dec 2009 at 7:56 am 189kiran grewal thanks for the great help……… 190.

varargin{:}).output. nor another program I got working based off this that worked elsewhere.. 194. will run properly on the version of MATLAB I’m using (7.com/matlab/matlab-gui-graphical-user-interface-tutorial.. ??? There is no ‘String’ property in the ‘figure’ class. Error in ==> myAdder at 42 gui_mainfcn(gui_State. Error in ==> myAdder>add_pushbutton_Callback at 134 a = get(handles.0) .For Beginners | blinkdagger http://blinkdagger.. Error in ==> gui_mainfcn at 75 feval(varargin{:}). but.Any help would be VASTLY appreciated. yesterday.’String’).buttonName) commands you’re using. i got an error. but make sure the tag property for all of your buttons match up with the get(handles. on 17 Dec 2009 at 9:53 am 196king 51 of 69 10/26/2010 4:10 PM .c).’String’.M Negranol. varargin{:}). 192.input1_editText. ??? Error while evaluating uicontrol Callback.. I’m gonna guess your issue is with the tag of you editText button. Zane 193. Error in ==> firstprogram at 44 gui_mainfcn(gui_State. am a newbie to matlab..5. on 08 Dec 2009 at 12:56 pm 192Zane Montgomery Hi S.. Make sure the Tag property has the name: ‘input1_editText’ You may need to check/fix your other buttons too.fig 196. can you help me sir?? pls. on 14 Dec 2009 at 7:46 am 195STB how can we edit a GUI ? if it save as . Double click your first editText button in the GUIDE editor to bring up the property inspector.. on 13 Dec 2009 at 12:21 pm 194midodo ‫ ازاى ممكن اعمل الة حاسبة باستخدام‬matlab GUI 195. on 12 Dec 2009 at 10:16 am 193Archana helo sir. Error in ==> gui_mainfcn at 96 feval(varargin{:}). Error in ==> firstprogram>add_Callback at 148 set(handles. i tried your tutorial step by step.MATLAB GUI Tutorial . ??? Error while evaluating uicontrol Callback Neither this. good luck.

… ‘gui_Callback’.For Beginners | blinkdagger http://blinkdagger..eventData. GUIDATA. gui_Singleton. All inputs are passed to expt4_OpeningFcn via varargin. varargin{:}). … ‘gui_OutputFcn’. see OutputFcn.…) creates a new EXPT4 or raises the % existing singleton*. Starting from the left.…) calls the local % function named CALLBACK in EXPT4. mfilename. @expt4_OpeningFcn. % hObject handle to figure % eventdata reserved . varargin) % This function has no output args.5 17-Dec-2009 23:31:08 % Begin initialization code . creates a new EXPT4 or raises the existing % singleton*. end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State. end % End initialization code . by itself. []). else gui_mainfcn(gui_State. % % EXPT4(’CALLBACK’. GUIHANDLES % Edit the above text to modify the response to help expt4 % Last Modified by GUIDE v2. % Update handles structure 52 of 69 10/26/2010 4:10 PM . [] . % % See also: GUIDE. % % EXPT4(’Property’. … ‘gui_LayoutFcn’.DO NOT EDIT % — Executes just before expt4 is made visible.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to expt4 (see VARARGIN) % Choose default command line output for expt4 handles. help me please badly needed… how can i display the answer of my transfer function to my static text…… function varargout = expt4(varargin) % EXPT4 M-file for expt4. An % unrecognized property name or invalid value makes property application % stop.gui_Callback = str2func(varargin{1}). eventdata. gui_State = struct(’gui_Name’. % % *See GUI Options on GUIDE’s Tools menu.M with the given input arguments.output = hObject. varargin{:}). property value pairs are % applied to the GUI before expt4_OpeningFcn gets called. function expt4_OpeningFcn(hObject.DO NOT EDIT gui_Singleton = 1.MATLAB GUI Tutorial . … ‘gui_Singleton’.hObject..handles. Choose “GUI allows only one % instance to run (singleton)”.fig % EXPT4. handles. % % H = EXPT4 returns the handle to a new EXPT4 or the handle to % the existing singleton*. if nargin && ischar(varargin{1}) gui_State. … ‘gui_OpeningFcn’.com/matlab/matlab-gui-graphical-user-interface-tutorial.'Value’. @expt4_OutputFcn.

handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved .to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles. eventdata.handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows..to be defined in a future version of MATLAB % handles empty . eventdata.. eventdata.’defaultUicontrolBackgroundColor’)) set(hObject. % UIWAIT makes expt4 wait for user response (see UIRESUME) % uiwait(handles.figure1). handles) % hObject handle to num (see GCBO) % eventdata reserved . handles) % hObject handle to den (see GCBO) % eventdata reserved . handles) % hObject handle to den (see GCBO) % eventdata reserved . end % — Executes on button press in pushbutton1. eventdata.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject.output.MATLAB GUI Tutorial .’String’)) returns contents of den as a double % — Executes during object creation.to be defined in a future version of MATLAB % handles empty . if ispc && isequal(get(hObject. handles).’BackgroundColor’).’String’)) returns contents of num as a double % — Executes during object creation. eventdata. % hObject handle to figure % eventdata reserved .com/matlab/matlab-gui-graphical-user-interface-tutorial. function pushbutton1_Callback(hObject. function num_Callback(hObject. after setting all properties. function den_CreateFcn(hObject.’BackgroundColor’.’BackgroundColor’). % See ISPC and COMPUTER.’String’) returns contents of num as text % str2double(get(hObject. if ispc && isequal(get(hObject.'white’). handles) % hObject handle to num (see GCBO) % eventdata reserved .to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject.’BackgroundColor’.’String’) returns contents of den as text % str2double(get(hObject. function num_CreateFcn(hObject. end function den_Callback(hObject. guidata(hObject. get(0. function varargout = expt4_OutputFcn(hObject. % See ISPC and COMPUTER.For Beginners | blinkdagger http://blinkdagger. eventdata.’defaultUicontrolBackgroundColor’)) set(hObject. get(0. after setting all properties.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) 53 of 69 10/26/2010 4:10 PM . % — Outputs from this function are returned to the command line.'white’). handles) % varargout cell array for returning output args (see VARARGOUT).handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.

. An % unrecognized property name or invalid value makes property application % stop.. 198.5 19-Jan-2010 11:11:47 % Begin initialization code .b)) set(handles. % % DEMO1('CALLBACK'. GUIDATA.. on 19 Dec 2009 at 9:21 pm 199Engineer M Saeed Anwer Gr8 very helpful for the beginners 200. handles) % hObject handle to text3 (see GCBO) % eventdata reserved . after setting all properties. on 18 Dec 2009 at 2:11 pm 198Kusse Thank you so much..MATLAB GUI Tutorial .num.den. % % *See GUI Options on GUIDE's Tools menu. % % DEMO1('Property'. b=str2num(get(handles.sys) % — Executes during object creation.DO NOT EDIT gui_Singleton = 1. GUIHANDLES % Edit the above text to modify the response to help demo1 % Last Modified by GUIDE v2. 54 of 69 10/26/2010 4:10 PM . Starting from the left.fig % DEMO1.) calls the local % function named CALLBACK in DEMO1. on 14 Jan 2010 at 6:04 am 200Sheh Fantastic tutorial! 201. creates a new DEMO1 or raises the existing % singleton*. guidata(hobject. eventdata.'Value'...handles not created until after all CreateFcns called 197.’String’. on 17 Jan 2010 at 1:04 am 201abhishek sir currently i am trying to develop a graph manipulating application using matlab . function text3_CreateFcn(hObject. % % H = DEMO1 returns the handle to a new DEMO1 or the handle to % the existing singleton*.hObject. on 18 Dec 2009 at 2:10 pm 197Kusse Thanks som much.’String’)).’String’)). Choose "GUI allows only one % instance to run (singleton)".handles) a=str2num(get(handles.eventData.. on 19 Jan 2010 at 7:53 am 202kanokwat function varargout = demo1(varargin) % DEMO1 M-file for demo1.com/matlab/matlab-gui-graphical-user-interface-tutorial. property value pairs are % applied to the GUI before demo1_OpeningFcn gets called. All inputs are passed to demo1_OpeningFcn via varargin. by itself.M with the given input arguments. I run my first GUI today.. 199. sys=(tf(a.text3.) creates a new DEMO1 or raises the % existing singleton*.For Beginners | blinkdagger http://blinkdagger.handles. % % See also: GUIDE. please and thanks 202.can you help me regarding this project .to be defined in a future version of MATLAB % handles empty . I run my first GUI today.

com/matlab/matlab-gui-graphical-user-interface-tutorial. 'gui_OpeningFcn'. end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State. eventdata.For Beginners | blinkdagger http://blinkdagger.. function edit1_Callback(hObject. % --. . set(hObject.MATLAB GUI Tutorial .DO NOT EDIT % --. @demo1_OutputFcn. . % --..y) guidata(hObject. handles) % varargout cell array for returning output args (see VARARGOUT).edit1. after setting all properties. eventdata.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject. % UIWAIT makes demo1 wait for user response (see UIRESUME) % uiwait(handles. 'gui_Callback'. % hObject handle to % eventdata reserved . else gui_mainfcn(gui_State.1 a=get(handles.gui_Callback = str2func(varargin{1})... []). varargin{:}). see OutputFcn. gui_Singleton.. if nargin &amp. handles..001:0. handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved .Executes just before demo1 is made visible. .to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %axes(handles. function demo1_OpeningFcn(hObject.'figure').. 'gui_Singleton'.axes1.handles). ischar(varargin{1}) gui_State.figure1). 'gui_OutputFcn'. . eventdata. handles) 55 of 69 10/26/2010 4:10 PM . gui_State = struct('gui_Name'.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles. [] . handles).'String')) returns contents of edit1 as a double % --. .Executes during object creation.axes1) t=0:0.Executes on button press in pushbutton1.. function varargout = demo1_OutputFcn(hObject. mfilename.t. handles) % hObject handle to edit1 (see GCBO) % eventdata reserved . function pushbutton1_Callback(hObject. varargin) % This function has no output args.. function edit1_CreateFcn(hObject.. eventdata.output = hObject.output. @demo1_OpeningFcn. eventdata. varargin{:}).'String') returns contents of edit1 as text % str2double(get(hObject.'toolbar'. % hObject handle to figure % eventdata reserved ..'string') x=str2num(a) y=sin(2*pi*50*x) plot(handles.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to demo1 (see VARARGIN) % Choose default command line output for demo1 handles. % Update handles structure guidata(hObject. 'gui_LayoutFcn'. end % End initialization code .&amp.Outputs from this function are returned to the command line..

com/matlab/matlab-gui-graphical-user-interface-tutorial.. end If my input is sin(2*pi*50*t) but program can’t read t t=time what should i do ? 203. % See ISPC and COMPUTER.&amp.'white'). if ispc &amp.'BackgroundColor'..MATLAB GUI Tutorial .. on 05 Feb 2010 at 1:05 am 206amit hansani hello. It really helps. how to do it?? 205.thanks a lot 209. my final year project is based on image segmentation using fuzzy connectedness…can u plz guide me through this…. However. This was really helpful. Thank you! Mike. on 04 Feb 2010 at 1:32 am 205Anshul Thank you very much for such great tutorial. isequal(get(hObject. 204. on 15 Feb 2010 at 4:49 pm 209AkilaMike Thanx Quan…. Thanks a lot for such a nice and simple to understand GUI tutorial 208.'defaultUicontrolBackgroundColor set(hObject.how can i include a image in matlab using GUI… 207. on 13 Feb 2010 at 6:28 pm 208lakshman simply great tutorial…very lucid and easy to understand…. I am personally in need to develop a GUI to be able to load an image and select coordinates on it as well as to clear those selection by using a push button.'BackgroundColor'). on 21 Jan 2010 at 5:32 pm 203Yunus Thank you for such a clear tutorial.to be defined in a future version of MATLAB empty .. % hObject % eventdata % handles handle to edit1 (see GCBO) reserved .handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. on 03 Feb 2010 at 7:33 pm 204shill123 Hello.. I was trying to make an adjustable horizontal line in a GUI plot. get(0. 206. M designing DTMF encoder/decoder in matlab using GUI.For Beginners | blinkdagger http://blinkdagger. on 15 Feb 2010 at 11:21 pm 210Iris Thanks for your tutorial! It’s very helpful and I finally laid out a GUI with buttons that work. on 10 Feb 2010 at 12:10 pm 207Kerem Hi.. here i want a figure to be displayed by checking a push button press in someother callback function. 210. I would be grateful if you have any resources which can help me in this. Is it possible? Any resources that I can look 56 of 69 10/26/2010 4:10 PM .

… ‘gui_LayoutFcn’.For Beginners | blinkdagger http://blinkdagger. … ‘gui_Callback’.fig % MYADDER. All inputs are passed to myadder_OpeningFcn via varargin.hObject.5 22-Feb-2010 12:22:58 % Begin initialization code .com/matlab/matlab-gui-graphical-user-interface-tutorial. by itself. … ‘gui_Singleton’. end % End initialization code . % % H = MYADDER returns the handle to a new MYADDER or the handle to % the existing singleton*. … ‘gui_OutputFcn’. varargin{:}).eventData. GUIHANDLES % Edit the above text to modify the response to help myadder % Last Modified by GUIDE v2. else gui_mainfcn(gui_State. if nargin && ischar(varargin{1}) gui_State. mfilename. … ‘gui_OpeningFcn’. gui_Singleton. creates a new MYADDER or raises the existing % singleton*.handles. Iris 211. % % MYADDER(’CALLBACK’. [] . Choose “GUI allows only one % instance to run (singleton)”.…) creates a new MYADDER or raises the % existing singleton*. into? Thanks.gui_Callback = str2func(varargin{1}).MATLAB GUI Tutorial ..the values are needed to be inserted into matrix and further algorithms will be carried out using the values inserted by the user….…) calls the local % function named CALLBACK in MYADDER. Starting from the left. []).'Value’.M with the given input arguments. % % *See GUI Options on GUIDE’s Tools menu. property value pairs are % applied to the GUI before myadder_OpeningFcn gets called. end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State.how do i do this? 212. An % unrecognized property name or invalid value makes property application % stop. @myadder_OpeningFcn. @myadder_OutputFcn.DO NOT EDIT gui_Singleton = 1. gui_State = struct(’gui_Name’. on 21 Feb 2010 at 10:52 pm 212maddy i am getting problem in doing this problem MATLAB CODE function varargout = myadder(varargin) % MYADDER M-file for myadder. % % MYADDER(’Property’.DO NOT EDIT 57 of 69 10/26/2010 4:10 PM .. GUIDATA. % % See also: GUIDE. on 17 Feb 2010 at 6:35 am 211hidayah how do i write the command if i need to instruct the user to insert values of an equation? i have an assignment which need the input from the user but i don’t know how to begin…. varargin{:}).

MATLAB GUI Tutorial - For Beginners | blinkdagger

http://blinkdagger.com/matlab/matlab-gui-graphical-user-interface-tutorial...

% — Executes just before myadder is made visible. function myadder_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to myadder (see VARARGIN) % Choose default command line output for myadder handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes myadder wait for user response (see UIRESUME) % uiwait(handles.figure1); % — Outputs from this function are returned to the command line. function varargout = myadder_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; function input1_editText_Callback(hObject, eventdata, handles) % hObject handle to input1_editText (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,’String’) returns contents of input1_editText as text % str2double(get(hObject,’String’)) returns contents of input1_editText as a double %store the contents of input1_editText as a string. if the string %is not a number then input will be empty input = str2num(get(hObject,’String’)); %checks to see if input is empty. if so, default input1_editText to zero if (isempty(input)) set(hObject,’String’,'0′) end guidata(hObject, handles); % — Executes during object creation, after setting all properties. function input1_editText_CreateFcn(hObject, eventdata, handles) % hObject handle to input1_editText (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’)) set(hObject,’BackgroundColor’,'white’); end function input2_editText_Callback(hObject, eventdata, handles) % hObject handle to input2_editText (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
58 of 69

10/26/2010 4:10 PM

MATLAB GUI Tutorial - For Beginners | blinkdagger

http://blinkdagger.com/matlab/matlab-gui-graphical-user-interface-tutorial...

% Hints: get(hObject,’String’) returns contents of input2_editText as text % str2double(get(hObject,’String’)) returns contents of input2_editText as a double %store the contents of input1_editText as a string. if the string %is not a number then input will be empty input = str2num(get(hObject,’String’)); %checks to see if input is empty. if so, default input1_editText to zero if (isempty(input)) set(hObject,’String’,'0′) end guidata(hObject, handles); % — Executes during object creation, after setting all properties. function input2_editText_CreateFcn(hObject, eventdata, handles) % hObject handle to input2_editText (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,’BackgroundColor’), get(0,’defaultUicontrolBackgroundColor’)) set(hObject,’BackgroundColor’,'white’); end % — Executes on button press in add_pushbutton. function add_pushbutton_Callback(hObject, eventdata, handles) % hObject handle to add_pushbutton (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) a = get(handles.input1_editText,’String’); b = get(handles.input2_editText,’String’); % a and b are variables of Strings type, and need to be converted % to variables of Number type before they can be added together total = str2num(a) + str2num(b); c = num2str(total); % need to convert the answer back into String type to display it set(handles.answer_staticText,’String’,c); guidata(hObject, handles); 213. on 26 Feb 2010 at 7:13 am 213Debasish Sarker Plz..help me..and if possible email me to my email address. I want to modify a gui.m file..my problem is..I have 3 m files of 3 equations. in these equations there are 2 unknown variables. from gui.fig i want to input these 2 unknown values by edit text and select an equation by pop-menu and get the result. How can I manage gui.m file of this problem?? anyone please help me.. 214. on 04 Mar 2010 at 11:15 pm 214Ritu Hi, I m really Thankfull 2 u for this nice and easily understandable tutorial. 215. on 05 Mar 2010 at 3:05 am 215Alen Hi, can you teach me how to generate sine wave in GUI?

59 of 69

10/26/2010 4:10 PM

MATLAB GUI Tutorial - For Beginners | blinkdagger

http://blinkdagger.com/matlab/matlab-gui-graphical-user-interface-tutorial...

Thank you 216. on 07 Mar 2010 at 1:45 am 216Anonymous supper 217. on 08 Mar 2010 at 9:59 am 217elea thank you so much for the tutorial 218. on 13 Mar 2010 at 7:58 am 218dut eden hey i have one Q how to get read for a matrix form..eg: i want to read 2000 4000 in static text both at the same time.. 219. on 13 Mar 2010 at 6:50 pm 219raj hey can u help me i have a program in which i am reading no of frames using ‘mmreader’ and then after reading all frames reading one particular frame as original and on converted to bW now i want to insert my prog to GUI but i dont know where excatlly i need to insert my matlab code in GUI (bcoz this is first time i am working with GUI) as i want to load the image and then enter to no of frame i want to read and save it plzz help me out 220. on 13 Mar 2010 at 6:53 pm 220raj hey can u help me i have a program in which i am reading no of frames using ‘mmreader’ and then after reading all frames reading one particular frame and convert it to bW now i want to insert my prog to GUI but i dont know where excatlly i need to insert my matlab code in GUI (bcoz this is first time i am working with GUI) as i want to load the video and then enter to no of frame i want to read and save it plzz help me 221. on 14 Mar 2010 at 7:47 am 221nandit I had a one problem. I just want to design a calculator same as TI-89 by using a MATLAB, but I didn’t know from where should I look the information. Somebody told you shall have to look at tutorial, but I didn’t get nothing over there. May be I am thinking that you can help me from figue out where the information I can find? 222. on 14 Mar 2010 at 7:49 am 222nandit 223. on 19 Mar 2010 at 12:11 pm 223saifi i m beggner please help me to learn GUI 224. on 19 Mar 2010 at 2:59 pm 224glasnost Well Done! I Like it! 225. on 19 Mar 2010 at 5:21 pm 225Hiba Hello dears I have an assignment to load an image to the Matlab GUI and 4 letters around it (a letter at each side of the image). Then in case a pushbotton is pressed, numbers are changed in random fashion. I wish to hear a clue in this with fully

60 of 69

10/26/2010 4:10 PM

@ztrans_OpeningFcn.. % % See also: GUIDE. on 09 Apr 2010 at 11:36 pm 228theepak thanks …very very usefull material simpler to understand… gret job sir.. on 10 Apr 2010 at 10:15 pm 229Mido_Ban hahahaha… wow..…) creates a new ZTRANS or raises the % existing singleton*. … ‘gui_OpeningFcn’. @ztrans_OutputFcn.For Beginners | blinkdagger http://blinkdagger. by itself.handles. All inputs are passed to ztrans_OpeningFcn via varargin. 228.MATLAB GUI Tutorial . GUIDATA.DO NOT EDIT gui_Singleton = 1. gui_Singleton. on 01 Apr 2010 at 1:08 pm 227thanks i really love you ….can you please help me in this regards…. An % unrecognized property name or invalid value makes property application % stop.…) calls the local % function named CALLBACK in ZTRANS. Starting from the left.if u can identify the problem… function varargout = ztrans(varargin) % ZTRANS M-file for ztrans.hObject. Choose “GUI allows only one % instance to run (singleton)”.'Value’. % % ZTRANS(’Property’. [] .M with the given input arguments. GUIHANDLES % Edit the above text to modify the response to help ztrans % Last Modified by GUIDE v2. gui_State = struct(’gui_Name’. i need your help in my project . … ‘gui_LayoutFcn’.fig % ZTRANS.5 11-Apr-2010 14:55:40 % Begin initialization code .actually i need a matlab program to simulate optical waveguide parameters. mfilename. appreciation. on 30 Mar 2010 at 2:43 am 226ANIL KUMAR hello. … ‘gui_Singleton’.. although in game one of my clan member actually has that name >_> and i doubt thats you because he’s like a senior in high school lulz.com/matlab/matlab-gui-graphical-user-interface-tutorial. creates a new ZTRANS or raises the existing % singleton*. on 11 Apr 2010 at 2:17 am 230Priyankar sir. i facing a trouble by modifying your source code to use it for finding the z transform of a function that i enter into the edit box …. 230. About 2 years ago I came to this site to learn how to use listchecker for dota… Now in college I needed to find some Matlab help and HERE I Come to the same website. % % H = ZTRANS returns the handle to a new ZTRANS or the handle to % the existing singleton*. Thanks blinkdagger. % % *See GUI Options on GUIDE’s Tools menu. 229.. % % ZTRANS(’CALLBACK’. … ‘gui_OutputFcn’. 227. hiba 226.eventData. … 61 of 69 10/26/2010 4:10 PM . property value pairs are % applied to the GUI before ztrans_OpeningFcn gets called. here the source code that i made for it ..

For Beginners | blinkdagger http://blinkdagger. eventdata. isequal(get(hObject. %checks to see if input is empty. function ztrans_pushbutton_Callback(hObject. handles). get(0. handles) %store the contents of input1_editText as a string. if ispc &amp.’String’) returns contents of input1_editText as text % str2double(get(hObject. handles) syms n a = get(handles. % hObject handle to figure % eventdata reserved . % Update handles structure guidata(hObject.’BackgroundColor’).DO NOT EDIT % — Executes just before ztrans is made visible.input1_editText. if nargin &amp.&amp. % — Outputs from this function are returned to the command line.output = hObject.figure1).com/matlab/matlab-gui-graphical-user-interface-tutorial. handles) % hObject handle to input1_editText (see GCBO) % eventdata reserved . varargin{:}).’BackgroundColor’. % UIWAIT makes ztrans wait for user response (see UIRESUME) % uiwait(handles. eventdata.’String’. eventdata.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to ztrans (see VARARGIN) % Choose default command line output for ztrans handles. eventdata.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject. and need to be converted % to variables of Number type before they can be added together 62 of 69 10/26/2010 4:10 PM . function varargout = ztrans_OutputFcn(hObject. handles. handles).MATLAB GUI Tutorial .to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.. ‘gui_Callback’. after setting all properties.’String’)).'0′) end guidata(hObject. varargin{:}). % hObject handle to input1_editText (see GCBO) % eventdata reserved . function ztrans_OpeningFcn(hObject. function input1_editText_Callback(hObject. []).’defaultUicontrolBackgroundColor set(hObject.&amp. eventdata. varargin) % This function has no output args. end % End initialization code . else gui_mainfcn(gui_State. ischar(varargin{1}) gui_State. default input1_editText to zero if (isempty(input)) set(hObject. if so.to be defined in a future version of MATLAB % handles empty . handles) % varargout cell array for returning output args (see VARARGOUT). function input1_editText_CreateFcn(hObject.output. end % — Executes on button press in ztrans_pushbutton.'white’).handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.’String’). % hObject handle to figure % eventdata reserved .’String’)) returns contents of input1_editText as a double % — Executes during object creation. if the string %is not a number then input will be empty input = str2func(get(hObject. end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State. % a and b are variables of Strings type. see OutputFcn.. % See ISPC and COMPUTER.gui_Callback = str2func(varargin{1}).

on 22 Apr 2010 at 11:09 pm 238anum nic demo 239. project 241. on 22 Apr 2010 at 9:33 am 237xaim Sir. on 15 Apr 2010 at 1:12 am 233jay Excellent tutorial for beginners. handles).thanks for the share 232.For Beginners | blinkdagger http://blinkdagger. % hObject handle to ztrans_pushbutton (see GCBO) % eventdata reserved . on 28 Apr 2010 at 9:09 am 239Anonymous thnx man! 240. i want to make a GUI for my project to make a preview of webcam and take a snapshot from the video coming.to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) 231.’String’. Xaim. 234. on 01 May 2010 at 5:08 am 241PARI hey. guidata(hObject.answer_staticText. plz reply fast. on 21 Apr 2010 at 9:13 am 235Zane Montgomery Pramod. % need to convert the answer back into String type to display it set(handles.The problem that i am facing is that the preview is not clear and the remaining functions are also not working properly. on 30 Apr 2010 at 5:09 am 240A Rasmy thanks alot man! u really helped me in my grad.. Click ‘Guide’ again and select the tab ‘Open Existing GUI’ 236. on 21 Apr 2010 at 12:20 pm 236Pramod Thanks Zane! 237. on 21 Apr 2010 at 4:52 am 234Pramod Is it possible to edit the GUI once it has been closed? How? Thanks in advance! 235.c). 238.com/matlab/matlab-gui-graphical-user-interface-tutorial. thankyou.. 63 of 69 10/26/2010 4:10 PM . on 13 Apr 2010 at 6:55 am 232Pramod Thanks a lot! was really clear and helpful 233. on 12 Apr 2010 at 5:59 pm 231ravi xcellent beginner tutorial….MATLAB GUI Tutorial . total = ztrans(a). c = func2str(total).Kindly help me in this regard.

on 13 May 2010 at 5:15 am 246mahdi dear sir since i use matlab version 5. on 10 May 2010 at 12:02 pm 245Prabhjot Hello Quan. I want to say that I really liked your tutorial. would you please create relevant GUI tutorial.com/matlab/matlab-gui-graphical-user-interface-tutorial. fixed point. how can we give out put of a row matrix into three different cells which we want to provide… pls help thanx in advance 245. it will be greated appreciated. or if its already available then . on 31 May 2010 at 11:58 pm 250Rana Awais iqbal Sir plz help me. on 02 May 2010 at 7:30 am 242Pramod What is the actual datatype to which the entered number is converted in str2num function? 243. on 30 May 2010 at 12:07 am 248Ashok Beautiful 249. how can i use assignin and evalin in matlab gui????????? 242.MATLAB GUI Tutorial . because I think above mentioned tutoraial is in latest version thank you indeed 247. if anyone can help me with it. we have to provide 5 inputs by user and 3 out put will be given..3. 246. I appreciate your efforts. thanking all in advance 250.. matrix multiplication etc Sir please help me 64 of 69 10/26/2010 4:10 PM . newton. on 27 May 2010 at 4:46 am 247Rodrigo Hello! First of all. can sumone give me a link to it. str2num takes a ’string’ and converts it to a ‘double’ (usually) 244. Could you help me? Thank you! 248. on 04 May 2010 at 9:08 am 244rahul thanx 4 this tutorial. it helped me a lot. on 31 May 2010 at 5:27 am 249vinit mittal i need a gui for solving ode.1. But I want to ask something: how can I set a String of a Static Text with a value that comes from the USB entry? My problem is to make a GUI to display 4 values (numbers) that comes from the USB into 4 Statics Text (and it needs to refresh itself). i wpuld like to generate a gui for a neuarl network trained by me and now to simulate the sresults i would like to generate gui.. on 03 May 2010 at 2:21 pm 243Zane Montgomery Pramod. our project are gui calculator by different program for example bisectin.For Beginners | blinkdagger http://blinkdagger.

newton. i get the following error When i run my function. on 06 Jul 2010 at 12:45 am 262mithchie where is the source file? 263. matlab) Deixe um Comentário [. Thank a lot for sharing with nice step by step procedure 253. on 10 Jun 2010 at 1:02 am 256links for 2010-06-10 « lugar do conhecimento [.MATLAB GUI Tutorial . on 01 Jun 2010 at 9:35 pm 252kureti Hello sir.. on 09 Jun 2010 at 3:15 am 255Stebbi great tutorial thx 256. on 02 Jun 2010 at 7:38 am 254miteran Nice one! 255... on 10 Jul 2010 at 9:55 am 263yunusemre Hi. on 01 Jun 2010 at 11:27 am 251Rana Awais iqbal Sir plz help me. 251. on 24 Jun 2010 at 9:21 am 259Saad welldone and thanks for sharing such a nice thing 260. our project are gui calculator by different program for example bisectin. on 11 Jun 2010 at 10:58 pm 257Krishna Thanks a lot !!! I was jumping when I run first GUI 258. PLEASE HELP ME! i will be grateful..com/matlab/matlab-gui-graphical-user-interface-tutorial.] MATLAB GUI Tutorial – For Beginners | blinkdagger (tags: work.] 257. kindly help us 252. on 02 Jun 2010 at 3:05 am 253leswiss Been looking for such a good tuto for hours !!!! THANK YOU !! 254. can anyone please give me the coding reply please on xtreme2610@hotmail. GUI that recalls my image from C drive. on 29 Jun 2010 at 8:40 am 260Anonymous It’s very clear. on 05 Jul 2010 at 3:43 am 261Noman Siddiqui i have to make GUI for my webcam. on 15 Jun 2010 at 8:18 pm 258subrahmanya Its nice explanation dear Thank you 259. matrix multiplication etc we submitted our project 3june 2010.. >> TestAutoCovarianceCPInt 65 of 69 10/26/2010 4:10 PM . fixed point. Nice basic example.com 262..For Beginners | blinkdagger http://blinkdagger.Thank your! 261.

268. please send me an e-mail as soon as possible. but still. on 19 Jul 2010 at 10:31 pm 265samin hi.. on 13 Jul 2010 at 12:12 am 264shehab nice and clear 265.For Beginners | blinkdagger http://blinkdagger. Error in ==> guide at 61 filename = guidetemplate. It would be great if you could help me resolve that.nvars == 0). on 16 Aug 2010 at 11:11 pm 268Anay brilliant !! but i have a small doubt… i tried the code total=str2num(a) + str2num(b) and i forgot to convert ‘total’ back to string type. Error in ==> guidetemplate at 88 copyfile(srcfigfile.50).com/matlab/matlab-gui-graphical-user-interface-tutorial. Thanks.MATLAB GUI Tutorial . the program worked ! why?? 269. Error in ==> roc at 20 if nargin == 0 | isempty(A) Error in ==> TestAutoCovarianceCPInt at 115 e=roc(dataset(SCORE{1}’.isempty at 11 t = (a.it just open the form and doesnt run this!what should i do?help me.yTE’). Error in ==> dataset. 66 of 69 10/26/2010 4:10 PM . ??? Reference to non-existent field ‘nobs’. ??? Error using ==> copyfile ‘attrib’ is not recognized as an internal or external command. ‘writable’).arami89@yahoo. i have a question! how can i open another fig file and run it when i use callback of a pushbutton?when i use winopen(’another file!’). on 04 Aug 2010 at 10:09 am 267Eng_Bandar very good. on 24 Jul 2010 at 9:37 am 266shonali Hey. my e-mail:s. 264. 267.As i type guide in the command window..i get the following error.com 266. we need some tutorial in how connect webcam by matlab gui. Im a Matlab beginner. targetfigfile. on 18 Aug 2010 at 1:10 pm 269helmy hello sir…im a matlab beginner and just doing my final project about comparing fingerprint algorithm using matlab gui. operable program or batch file.nobs == 0) || (a.

g in the first file.. In button callback function I input: set(handles. 277. thanks. on 19 Oct 2010 at 9:54 am 278Matlab GUI实现基于ADPC方法的ABAQUS输入文件和两相子程序的生成 « 亘古之 伤 [..i am waiting for next tutorial sheeet…. [. i want to link many gui files.narith If I have two push buttons in GUIDE. after clicking a button “NEXT”.] Matlab GUI Interface Tutorial For Beginner form Blinkdagger. I discovered. 278. 273.. on 30 Sep 2010 at 12:59 pm 273Matlab GUI for Engaged Learning | Freedom University Tutorial Videos [. How can I do? Thanks.Dhinakarraj Can any one explain me about the linking of ANN file to frontend GUI of matlab 272. on 15 Sep 2010 at 5:21 am 272sreenu hi.com.thanks sir……. Hope to get more tutorials over here Awesome. I used this one to create my first GUI..estym. but if I open my GUI directly from MATLAB command windows I see error: ??? Attempt to reference field of non-structure array. if is this error ‘handles’ is empty 276.MATLAB GUI Tutorial ..For Beginners | blinkdagger http://blinkdagger... I see value of ‘b’ in ‘estym’.] 为了实现这一目标,我没有采用老哥建议的C#语言,而更加倾向于Matlab。虽然我曾经有过matlab编程经 历,但是Matlab GUI和我还是第一次亲密接触,经过学习发现,Matlab GUI的功能强大,有着所见即所得的开发 67 of 69 10/26/2010 4:10 PM . i must enter to the next file(page).com/matlab/matlab-gui-graphical-user-interface-tutorial. on 09 Oct 2010 at 11:17 am 275Mathew HELP! I’ve got some strange behavior of MATLAB. num2str(b)).. on 03 Sep 2010 at 10:21 pm 271C. and if I run my GUI using green “play” button in GUIDE Editor everithing if fine..] 274. on 08 Oct 2010 at 5:45 am 274ajeet Really good tutorial for MATLAB fresher…. How can i do that??? for e. i wanna ask how to put these algorithm in matlab gui? hopefully you can help me … thanks 270... on 29 Aug 2010 at 4:21 am 270Dr.K.Ivanobich Excellent workdone…I really appreciate it. 271.thanks a lot. i m a beginner.thanks a lot for posting this good and simple example gui. 275. and so on. 'string'. on 17 Oct 2010 at 1:13 am 276Amit hi. on 18 Oct 2010 at 6:43 pm 277ls. I just want to write code in the first callback’s button and the second button I want to call it from the first one.

You are really great Leave a Reply Include MATLAB code in your comment by doing the following: <pre lang="MATLAB"> %insert code here </pre> Name Mail (hidden) Website 68 of 69 10/26/2010 4:10 PM . Thanks very very very much. 环境,内置的GUI handles整体变量可以在一个GUI figure所对应的所有动作应用函数里面方便调用,而且程序调 试的时候非常方便,这得益于matlab编译系统的简洁明白的特性。这里特别要推荐一个学习Matlab GUI非常赞 的网站:blinkdagger。正是通过学习该网站循序渐进的tutorial才让我在三天内顺利地完成了ADPCgeneratro的开 发。 [. on 25 Oct 2010 at 8:36 am 279sinan This is the best tour for GUI I have ever seen..For Beginners | blinkdagger http://blinkdagger...] 279.com/matlab/matlab-gui-graphical-user-interface-tutorial..MATLAB GUI Tutorial .

. Sander Land!!! Monday Math Madness #34: Crossing a Bridge MATLAB GUI Tutorial .com/NokiaLebanon Ads by Google Ads by Google Gui Design MATLAB 7.UITABLE Part 2.For Beginners | blinkdagger http://blinkdagger. Facebook.com/matlab/matlab-gui-graphical-user-interface-tutorial. How To Access Table Data Copyright ©2010 blinkdagger Posts RSS Comments RSS WordPress Theme designed by David Uliana · XHTML · CSS 69 of 69 10/26/2010 4:10 PM . Possibly MATLAB .1 Gui Development Gui Programming The MathWorks Blog Ring Undocumented MATLAB Tips Data Mining in MATLAB I want an iPad Search for: The End of Blinkdagger? .. ..Global Variables MMM #34 Winner. .MATLAB GUI Tutorial .

Sign up to vote on this title
UsefulNot useful