Sei sulla pagina 1di 67

MATLAB GUI Tutorial - Plotting Data to Axes

31 Oct 2007 Quan Quach 134 comments 25,632 views

Introduction
In this Matlab GUI tutorial, you will learn how to create and use the Axes component !he Axes component allows you to display "raphics, such as "raphs and ima"es on your GUI In this tutorial, we will create two a#es on the GUI and plot some simple data onto it In addition, we will include a reset button to clear the a#es and we will also add the standard toolbar to allow the user to $oom, pan, and %uery the plot

!his tutorial is written &or those with little or no e#perience creatin" a Matlab GUI 'Graphical User Inter&ace( I& you)re new to creatin" GUIs in Matlab, you should visit this tutorial &irst *asic +nowled"e o& Matlab is recommended Matlab version 2,,-a is used in writin" this tutorial *oth earlier versions and new versions should be compatible as well 'as lon" as it isan)t too outdated( .et)s "et started/

Create the Visual Aspect of the GUI


1 0irst, open up Matlab Go to the command window and type in guide

1ou should see the &ollowin" screen appear 2hoose the &irst option Blank GUI
(Default)

3 4

2lic+ on and add two Axes components to the GUI &i"ure 3e#t, clic+ on and add three Pushbutton components onto the GUI &i"ure 4ouble clic+ the Axes component to brin" up the 5roperty Inspector 2han"e the Tag property to axes1, which should already be the de&ault name 6dditionally, ma+e sure the other Axes component)s Tag property is named axes2

3e#t, let)s modi&y the properties o& the Pushbutton components 4ouble clic+ on one o& the Pushbutton components 2han"e the String property to Plot Axes 1, and the Tag property to plotAxes1_pushbutton, as shown below

7imilarly, double clic+ on the ne#t pushbutton and chan"e the String property to Plot Axes 2 and chan"e the Tag property to plotAxes2_pushbutton 0inally, double clic+ on the &inal pushbutton and chan"e the String property to Clea Axes and chan"e the Tag property to !lea Axes_pushbutton 6 8ere)s what your &i"ure should loo+ li+e a&ter you add the components and modi&y them

7ave your GUI wherever you please with your desired &ilename

riting the Code for the GUI


Matlab automatically "enerates an m &ile to "o alon" with the &i"ure that you 9ust put to"ether !he m &ile is where we attach the appropriate code to the callbac+ o& each component 0or the purposes o& this tutorial, we are primarily concerned only with the callbac+ &unctions 1ou don)t have to worry about any o& the other &unction types 1 :pen up the m &ile that was automatically "enerated when you saved your GUI In the Matlab editor, clic+ on the icon, which will brin" up a list o& the &unctions within the m &ile 7elect plot1_pushbutton_Callback

6dd the &ollowin" code to the &unction;


"sele!ts axes1 as the !u ent axes# so that "$atlab kno%s %he e to plot the data axes(handles&axes1) "! eates a 'e!to x - ).1)/ "! eates a 'e!to 0 - ).1)/ f o( ) to 1)# *) 1 2 + & & & 1), f o( ) to 1)# *) 1 2 + & & & 1),

"plots the x and 0 data plot(x#0)/ "adds a title# x1axis des! iption# and 01axis des! iption title(2Axes 12)/ xlabel(23 data2)/ 0label(24 data2)/ guidata(h5b6e!t# handles)/ "updates the handles

7imilarly, we want to put the &ollowin" code into the plot2_pushbutton_Callback;

+& "sele!ts axes2 as the !u ent axes# so that 7& "$atlab kno%s %he e to plot the data 8& axes(handles&axes2) 9& :& "! eates a 'e!to f o( ) to 1)# *) 1 2 + & & & 1), ;& x - ).1)/ <& "! eates a 'e!to *) 1 7 < & & & 1)), 1)& 0 - x&=2 11& 12& "plots the x and 0 data 1+& plot(x#0)/ 17& "adds a title# x1axis des! iption# and 01axis des! iption 18& title(2Axes 22)/ 19& xlabel(23 data2)/

1:& 0label(24 data2)/ guidata(h5b6e!t# handles)/ "updates the handles

1< 3e#t, we need to add some code to the clearPlots_pushbutton_Callback;


1<& "these t%o lines of !ode !lea s both axes 2)& !la(handles&axes1#2 eset2) 21& !la(handles&axes2#2 eset2) guidata(h5b6e!t# handles)/ "updates the handles

22 6nd &inally, we need to add the &ollowin" line o& code to axes_tutorial_Opening cn;
set(h5b6e!t#2toolba 2#2figu e2)/

!his line o& code should be placed ri"ht be&ore;


guidata(h5b6e!t# handles)/

!his line o& code e&&ectively adds the standard toolbar to the GUI, allowin" the user to $oom, pan, %uery the plot, and more !he standard toolbar and a brie& description o& the icons are shown below;

23 7ave your m=&ile/

!un and Test the GUI


3ow that we)ve completed both the visual and code aspects o& the GUI, its time to run the GUI to ma+e sure it wor+s 1 0rom the m=&ile editor, you can clic+ on the icon to save and run the GUI 6lternatively, &rom the GUI4> editor, you can clic+ on the to launch the GUI !he &ollowin" GUI should appear once you clic+ the icon;

Go ahead and try pressin" all o& the buttons to ma+e sure they wor+ I& everythin" was done correctly, you should see the &ollowin" plots 6lso, you can use the icons that are within the red bo# to test out the other &unctions

6nd that)s it !hose are the basics o& usin" the Axes component 1ou can e#plore the other options that the a#es has to o&&er throu"h the 5roperty Inspector

!his is the end o& the tutorial 7ource &iles can be downloaded here

"#$ !esponses to %MATLAB GUI Tutorial - Plotting Data to Axes&


1 on 12 !an 200" at 12#$" p% 1&aibha' (e)ia ?hen i close M6!.6* and start "uide a"ain my a#es loses its !6G and hence becomes invisible 8ow do i solve this@ 2 on 20 !an 200" at $#$" p% 2Alex nice one/ U need to write some more stu&& &or be"inners 3 on 13 eb 200" at 3#*+ p% 3Saikat !han+ you so much A I love your style and &ind your instructions very help&ul Goin" throu"h the pro"rams you have written &or us, the be"inners, I &eel more con&ident o& writin" my own codes AAA !han+ you once a"ain AA 4 on 17 eb 200" at 11#03 a% $Tant, ?hat a "reat tutorial Im wor+in" on my &inal pro9ect, so this tutorial help me solve my problem writin" the code &or a#es !han+s 5 on 17 -ar 200" at +#*7 p% *lo'e.o, how to plot a resultant vector in GUI e# 1,3B53 6 on 2/ -ar 200" at $#2" a% /nola very nice tutorial however i had a %uery &or you when i do a $oom on the ima"e and clic+ one pushbutton to ma+e an action the ima"e return to its initial dimensions'i loose the $oom(Acould you help me on this sub9ect@ on 2/ -ar 200" at 12#37 p% 70aniel Suto,o 8i 3ola

"ood %uestionA althou"h I haven)t tried to code it yet, what you need to do is to "et the new a#es in&o and store it somewhere 0or e#ample, your a#es is called handles a#es1 1ou will have to use the "et'( and "et the min,ma# a#is on handles a#es1 and store in a variable &or e#ample mya#is 3ow in your pushbutton &unctionA when you have a plot command, ma+e sure you use the a#is in&o in mya#is < on 10 Apr 200" at 3#$3 a% "an), 8ow do we plot a "raph where the &unction o& "raph is +ey in by user@ I mean we can plot many di&&erent &unction o& "raph 9ust by chan"in" &unction@ C on 17 Apr 200" at 11#$2 a% +harsha very nice, it helped me a lot !han+s, I love the way u have e#plained the whole process very clear/ 1, on 22 Apr 200" at +#*7 a% 10Al1re)o 2uerta 0uran Muy buena tu pa"ina, la estare consultando a menudo 4e antemano te doy las "racias por la &uturas visitas a tu tutorial 6l&redo 8uerta 11 on 13 !un 200" at 11#*" p% 11shanshui2"1 !han+ you very much / I learna lot o& s+ills &rom this websit/ 12 on 22 !un 200" at 10#*/ p% 12abhi.it betal 4ear 7ir, !his tutorial helps me a lot !han+s &or it ?ill you provide a tutorial on basic concept o& the GUI4> @ ?ith than+s 6bhi9it *etal 13 on 23 !un 200" at 12#$0 p% 13sath,a I used a series o& chec+bo#es, each to plot the derivatives o& a &unction ?hen I clic+ on the chec+bo#, the plot sholud appear and when I unclic+ it, the plot should disappear I used Dhold on) on each chec+bo# callbo#es, so that when I clic+ all o& them I should see all the plots I tried usin" cla, but it clears the whole a#es I& I unchec+ the &irst chec+bo#, only the plot correspondin" to it should disappear 6ny help@

14 on 01 !ul 200" at 3#27 a% 1$ah%e) ba)r can i as+ %uestion i have plot between e&iciency and threshold and i "et ma# e&&iciency can i "et threshold on ma# e&&iciency in "ui o& matlab code 15 on 22 !ul 200" at 2#** p% 1*Arash 4ear sir, I want to +now how to capture the coordination o& my "raph@ can you help me with that 16 on 22 !ul 200" at *#01 p% 1/Quan Quach 6rash, 2an you elaborate on your %uestion@ I don)t %uite understand it Euan 1- on 23 !ul 200" at 11#$/ a% 17Arash Euan, I want +now is it any way to capture '#,y( o& "raph a&ter plottin" it, I mean a&ter plottin" a "raph, I want to be able to clic+ on "raph and see dot)s on "raph at my every '#,y(, &or e#mple i& I am plottin" #Fy, a&ter plottin" I want to be able to clic+in" on "raph and then I "et dots on "raph at '1,1( '2,2('=1,=1( and A I am not sure i& there be anyawy to doin" this@'I am really newcomber in Matlab GUI( I appreciate your help !han+ you, 6rash 1< on 23 !ul 200" at 1#2$ p% 1"Quan Quach 8i 6rash, Use the data cursor icon to do this 7ee the last picture in this tutorial !he icon inside the ri"ht o& the red bo# is the one you want to use 2lic+ on this and then clic+ on the curve Euan 1C on 2$ !ul 200" at +#22 a% 1+Arash

8i Euan, !han+ you, I didn)t "et chance to try yet, I will let you +now appreciate your help !han+ you, 6rash 2, on 30 !ul 200" at 7#** a% 20Arash 8i, !han+ you, it really helped, but is it any way to "et coordination with out usin" tool bar, I mean is it any way to write &unction to do that, havin" more control on tool bar, &or instance i& we have to plot, so we have control some how to chec+ coordination o& either one at a time and cursar be re"ular cursar &or other one@ !han+ you, 6rash 21 on 30 !ul 200" at "#10 a% 21Arash 8i, to "ive more, I am really new in Matlab but when I was readin" tutorial &or Gadio *uttons, !o""le *uttons, and *utton Group 5anel I thou"ht may be I can with set'handles &ont7electHbutton"roup,)7election2han"e0cn),I&ont7electHbutton" roupH7election2han"e0cn(J 2reate a &unction &or "ettin" coordination and then put push button &or my plot so when I clic+ that button or chec+bo# my cursar "oes to "ettin" coordination mode and "et that instead o& usin" toolbar and I can put 2 di&&erent chec+bo# or button &or 2 di&&erent plot in my pro"ram !han+ you, 6rash 22 on 30 !ul 200" at 1#1/ p% 22Paul 0 6rash, a way to "et the cursor position in your pro"ram without usin" the toolbar is as &ollows lFdatacursormodeJ l4ataF"et'l,)4ata2ursors)(J posF"et'l4ata,)5osition)(J you can also set the cursor position by doin" the above in reverse with )set) commands !est it out and you)ll see that it wor+s pretty well 5aul

23 on 30 !ul 200" at 1#20 p% 23Paul 0 :r even lFdatacursormodeJ posF"et'l 4ata2ursors,)5osition)(J 24 on 30 !ul 200" at 3#*/ p% 2$Arash 8i paul, I creat 2 button &or my 2 &i"ure and put the code you "ave me at callHbac+ event o& those but I "et error basically my "oal is to control cursor some how when I clic+ the button &or that plot when I move my mouse on &i"ure I "et coordination o& that point, 9ust li+e a time I use toolbar 6rash 25 on 31 !ul 200" at /#*/ a% 2*Paul 0 i)m not sure e#actly at what you are tryin" to accomplish 8ere is a little "o throu"h that you can 9ust copy and paste into matlabs command prompt that will show the capabilities that I am discussin" #FK,; 1;1,LJ yF#M2B2N#J "raphFplot'#,y(J lFdatacursormode'"raph(J 3:? "oto the &i"ure that 9ust popped up and put a cursor position on the "raph 3:? "o bac+ to the command prompt and type posF"et'l 4ata2ursors,)5osition)( you will see that the variable pos holds the coordinates o& the cursor I do believe that this is the capability that you re%uested !his should be enou"h in&ormation to help you do whatever you want to do wO capturein" the coordinates o& a cursor 26 on 10 Aug 200" at 3#*0 p% 2/Ashutosh (har)3a. 8elped me a .:! with GUI pro"rammin" you "uys should come out with a boo+ // 2- on 1+ Aug 200" at 1#*7 a% 274r !han+ you very much &or this tutorial/// Matlab)s help &iles are very con&usin" &or me every time !hese tutorials are very help&ul

2< on 2+ Aug 200" at 3#03 p% 2"5o%an 8i Euan Euach, do you have a tutorial about writin" a GUI that allows si"nals, lets say, &rom a si"nal "enerator throu"h serial port, to be displayed on the "ui@ !han+s 2C on 2+ Aug 200" at +#*3 p% 2+Quan Quach 8i Goman, I haven)t dealt with data ac%uisition usin" M6!.6* 7o cannot help you there 8ope&ully I will use it in the &uture and I can write a tutorial on it/ Euan 3, on 2$ Sep 200" at *#1+ a% 3006&A4A40 8ello Euan, ?hat a nice wor+ this site is I am an M=be"inner I have a doubt I have a GUI4> application 3ow I wanted to unchec+ and chec+ the chec+bo#es by clic+in" a pushbutton 8ow can it be done , pl$ help me !863P7 I3 64Q632> 31 on 2/ Sep 200" at 2#2" p% 31sath,a 4evanand, In the pushbutton callbac+, use set'handles chec+bo#,)Qalue),1( to chec+ the chec+bo# and set'handles chec+bo#,)Qalue),,( to unchec+ it 32 on 2/ Sep 200" at 2#3$ p% 32Quan Quach 4evanand, 7athya seems to hae beaten me to the punch !han+s 7athya/ Euan 33 on 2/ Sep 200" at 2#37 p% 33sath,a !han+s to you Euan 0or the past si# months I have been wor+in" on M6!.6* and your tutorials have helped me a lot 34 on 2/ Sep 200" at 2#3+ p% 3$Quan Quach

Glad you &ound our site help&ul/ Euan 35 on 2+ Sep 200" at /#2+ p% 3*7ia% 0antastic tutorial I was ama$ed that I could "et a small pro9ect wor+in" ri"ht o&& the bat based on this 8owever, I have 2 %uestions; 1 7uppose I have two sliders and want to plot a point on the a#es based on the values o& the sliders ?hich callbac+ &unction should do the plottin"@ ?hat)s the best way to approach this@ 2 Is there any way to turn o&& the automatic resi$in" o& the a#es@ I want the a#es to stay &i#ed re"ardless o& the data bein" plotted !han+s very much/ .iam 36 on 2+ Sep 200" at "#*1 p% 3/Quan Quach 8i .iam, Glad you &ound these tutorials help&ul &or %uestion 2; I& you +now what your # and y limits will be, you can do the &ollowin";
axis(*x(in x(ax 0(in 0(ax,)

0or %uestion 1; 1ou would want to put your plottin" code in the callbac+ &or the slider wid"et >very time the slider value is chan"ed, the callbac+ is activated 3ote that the slider callbac+ is only activated each time you clic+ the mouse Good luc+/ 3- on 2+ Sep 200" at +#0+ p% 377ia% !han+s, Euan Ideally, I)d li+e the a#es to update i& any o& the sliders are modi&ied Gi"ht now it only updates i& the slider within which the plot code is written is clic+ed on Is there some sort o& re&resh plot command@ :ne more %uestion, how do you retrieve the layout window o& a GUI a&ter closin" it@ I& I try reopenin" the &i" &ile, the GUI opens in a mode in which it can)t be modi&ied !han+s very much/ .iam

3< on 2+ Sep 200" at +#12 p% 3"Quan Quach 8i .iam, I would write a separate plot &unction, and then call this plot &unction within both o& your slider callbac+s 0or your second %uestion, you want to open it usin" GUI4> 6t the M6!.6* command prompt, type in D"uide), and then open an e#istin" pro9ect Euan 3C on 0/ Oct 200" at 3#*/ p% 3+!esse Euan, et al, I have 3 separate "raphs I am tryin" to display in my GUI window with the use o& radio buttons I have "enerated and a#es bo# called Graph and initiali$ed it with the a 9pe"
" Iniitali>e 6pg in axes G aph at sta t up 11 !ase 2initiali>e2 axes(handles&G aph)/ pi!tu e1 - i( ead(2Pi!s?G aphs&6pg2)/ i(age(pi!tu e1)/ axis off/

?hen the GUI appears the user enters data that is read in to do some calculations I have written stand alone code that plots all three "raphs 'errorbar, bar, RS1( My main issue I am havin" is how to separately save those plots or "et them displayed when selectin" a radio button ?ith stand alone code I can "et all three plots saved as 9pe"s, but is there a way to 9ust have them displayed directly into a#es named Graph I have some how accidentally done it with the &irst plot and it loo+s much cleaner than loadin" a 9pe" 'which is what I am doin" now( 8ere is an e#ample o& my stand alone plot code *y the way I am usin" switch and case to inter&ace with the radio puttons 6tlas is my "ui code created by "uide and "uien"ine is my &unction where most o& my actual code is located and passed into atlas
" 11 Plot of $ean %ith @ o ba s 111 esults_in - xls ead(2Use 5utput&xls2)/ AistBt - esults_in(1.k#1)/ x_axis - AistBt / 0_axis - esults_in(1.k#2)/ e o - esults_in(1.k#+)/ e o ba (x_axis#0_axis#e o #2s 2#&&& 2AineCidth2#)#&&& 2$a ke @dgeColo 2#2k2#&&& 2$a ke Da!eColo 2#*&7< 1 &9+,#&&& 2$a ke Bi>e2#;)

axis(*) 1))) ) 1,) title 2Pe !ent @ne(0 Eilled b0 Case Fu(be 2 xlabel(2Case Fu(be 2)/ 0label(2Pe !ent @nen(0 Eilled2)/ g id on p int 1f1 1d6peg 2Pi!s?$ean&6pg2 !lose figu e 1/ " Code in guiengine to displa0 $ean G aph 11 !ase 2(ean2 axes(handles&G aph)/ (ean - i( ead(2Pi!s?$ean&6pg2)/ i(age((ean)/ axis off/ "Gadio Button fun!tion to displa0 $ean G aph " 111 @xe!utes on button p ess in @ne(0Eilled& fun!tion @ne(0Eilled_Callba!k(h5b6e!t# e'entdata# handles) get (handles&atlas# 2use data2)/ *handles, - guiengine(handles#2(ean2)/

8ope&ully this isn)t too much to ta+e in I& there is a better way to utili$e the Gadio *uttons to e#ecute the code I am all &or it I would rather not have a 9pe" displayed since its "ets severely distorted !han+s in advance Tesse 4, on 0/ Oct 200" at $#$1 p% $0!esse ?ell I was wonderin" why there wasn)t more to the tutorial and then a&ter I sent my messa"e I noticed there was a second pa"e 'oops( !hat "ot me to accomplish what I wanted above, but I am "ettin" this error in the command window;
Undefined fun!tion o @ o 'a iable 2h5b6e!t2&

in --Hgt/ guiengine at 1)< guidata(h5b6e!t# handles)/

@ o in --Hgt/ DBI_AIAABHgt/JeloDlights_Callba!k at <8+ *handles, - guiengine(handles#2nu(_flight2)/ @ @ o o in --Hgt/ gui_(ainf!n at <9 fe'al('a a ginK.L)/ in --Hgt/ DBI_AIAAB at 72 gui_(ainf!n(gui_Btate# 'a a ginK.L)/

@ o in --Hgt/ guide(fileHgt/M(h5b6e!t#e'entdata)DBI_AIAAB(2JeloDlights_Callba! k2#h5b6e!t#e'entdata#guidata(h5b6e!t)) NNN @ o %hile e'aluating ui!ont ol Callba!k

!han+s Tesse 41 on 0/ Oct 200" at /#2/ p% $1Quan Quach 8i Tesse, 7o lets say you have 3 radio buttons I)m "oin" to assume you +now how to use radio buttons, but i& not, ta+e a loo+ here '"o to pa"e 3 o& this tutorial(; http;OOwww blin+da""er comOmatlabOmatlab="ui=tutorial=buttons=button="roup 0irst, set up your buttons into the button panel accordin"ly
"set the sele!tion fun!tion in the opening fun!tion of 0ou GUI set(handles&plotBele!t_buttong oup#2Bele!tionChangeD!n2#MplotBel e!t_buttong oup_Bele!tionChangeD!n)/

3e#t, put this code into your button "roup call bac+
fun!tion plotBele!t_buttong oup_Bele!tionChangeD!n(h5b6e!t# e'entdata) " et ie'e GUI data# i&e& the handles st u!tu e handles - guidata(h5b6e!t)/ axes(handles&G aph) "set the axes to %he e the data %ill be plotted s%it!h get(e'entdata&Fe%Oalue#2Iag2) " Get Iag of sele!ted ob6e!t !ase 2plot1_ adiobutton2 "exe!ute this !ode %hen plot1_ adiobutton is sele!ted "put the !ode that plots 0ou data he e !ase 2plot2_ adiobutton2 "exe!ute this !ode %hen plot2_ adiobutton is sele!ted "put the !ode that plots 0ou data he e !ase 2plot+_ adiobutton2 "exe!ute this !ode %hen plot+_ adiobutton is sele!ted "put the !ode that plots 0ou data he e othe %ise " Code fo %hen the e is no (at!h& end "updates the handles st u!tu e guidata(h5b6e!t# handles)/

8ope that helps, Euan 42 on 23 Oct 200" at 11#21 p% $2(ase 1ou r the manA !his helped a lot

than+s =*ase 43 on 2" Oct 200" at "#11 a% $3Pietro 8i, I would li+e to have a dynamic plottin"; try to update the plot every time I have a new value !he easier way to do it is to re=plot every time all the previous values, but it is too slow, so I am loo+in" &or a solution that allows to add only the last value without loosin" the previous ones I cannot use Uhold onV because I need a continuous line !han+s &or your help 5ietro 44 on 2" Oct 200" at +#$0 a% $$(ernar) 0irst o& all than+s &or your clear tutorial/ In the comments you write that one can also write a Dplot &unction) I tried to do this, but can)t "et it to wor+A could you please provide an e#ample o& this@ !han+s a lot/ *ernard 45 on 2" Oct 200" at 2#*0 p% $*Quan Quach 5ietro, 8ow about plottin" the last two values instead o& the last value@ !his will still "ive you a line 0or instance you could do
plot(data(end11.end))

46 on 2" Oct 200" at 2#*2 p% $/Quan Quach 8i *ernard, 6 simple plot &unction mi"ht loo+ li+e this;
fun!tion plot$0Data(xData#0Data) "do an0 data (anipulation he e plot(xData#0Data) on 2+ Oct 200" at /#$" a% $7Pietro

4-

!han+s Euan, "ood idea Great tutorials 5ietro 4< on 02 4o' 200" at +#$0 p% $"tas,a please help meeee// can someone "v me the solution@ i)m creatin" simple "ui with welcomin" te#t and a picture on the top o& it i)ve put the a#es when i "enerate, the ima"e will be displayed, when i open bac+, the ima"e "one 9e$ le&t the a#es itsel& the same thin" happen when i Dlin+) or switch to the ne#t inter&ace the ima"e "oneApleaseee help meAim usin" matlab v - 2 intanHtassyaIyahoo com &unction varar"out F ?elcomeH!oHG5H477'varar"in( W ?>.2:M>H!:HG5H477 M=&ile &or ?elcomeH!oHG5H477 &i" W ?>.2:M>H!:HG5H477, by itsel&, creates a new ?>.2:M>H!:HG5H477 or raises the e#istin" W sin"letonN W W 8 F ?>.2:M>H!:HG5H477 returns the handle to a new ?>.2:M>H!:HG5H477 or the handle to W the e#istin" sin"letonN W W ?>.2:M>H!:HG5H477')26..*62P),h:b9ect,event4ata,handles,A( calls the local W &unction named 26..*62P in ?>.2:M>H!:HG5H477 M with the "iven input ar"uments W W ?>.2:M>H!:HG5H477')5roperty),XQalue),A( creates a new ?>.2:M>H!:HG5H477 or raises the W e#istin" sin"letonN 7tartin" &rom the le&t, property value pairs are W applied to the GUI be&ore ?elcomeH!oHG5H477H:penin"0unction "ets called 6n W unreco"ni$ed property name or invalid value ma+es property application W stop 6ll inputs are passed to ?elcomeH!oHG5H477H:penin"0cn via varar"in W W N7ee GUI :ptions on GUI4>)s !ools menu 2hoose UGUI allows only one W instance to run 'sin"leton(V W W 7ee also; GUI4>, GUI46!6, GUI8634.>7 W >dit the above te#t to modi&y the response to help ?elcomeH!oHG5H477 W .ast Modi&ied by GUI4> v2 5 24=7ep=2,,< 16;22;,-

W *e"in initiali$ation code = 4: 3:! >4I! "uiH7in"leton F 1J "uiH7tate F struct')"uiH3ame), m&ilename, A D"uiH7in"leton), "uiH7in"leton, A D"uiH:penin"0cn), I?elcomeH!oHG5H477H:penin"0cn, A D"uiH:utput0cn), I?elcomeH!oHG5H477H:utput0cn, A D"uiH.ayout0cn), KL , A D"uiH2allbac+), KL(J i& nar"in SS ischar'varar"inY1Z( "uiH7tate "uiH2allbac+ F str2&unc'varar"inY1Z(J end i& nar"out Kvarar"outY1;nar"outZL F "uiHmain&cn'"uiH7tate, varar"inY;Z(J else "uiHmain&cn'"uiH7tate, varar"inY;Z(J end W >nd initiali$ation code = 4: 3:! >4I! W [ >#ecutes 9ust be&ore ?elcomeH!oHG5H477 is made visible &unction ?elcomeH!oHG5H477H:penin"0cn'h:b9ect, eventdata, handles, varar"in( W !his &unction has no output ar"s, see :utput0cn W h:b9ect handle to &i"ure W eventdata reserved = to be de&ined in a &uture version o& M6!.6* W handles structure with handles and user data 'see GUI46!6( W varar"in command line ar"uments to ?elcomeH!oHG5H477 'see Q6G6GGI3( a#es'handles pic1(J imshow')1st 9pe")(J display')1st 9p")( Wis this the correct way@when i clic+ Dne#t), the ima"e wont displayed either, when i "enerate usin" "uide, the ima"e will be displayed why@ W 2hoose de&ault command line output &or ?elcomeH!oHG5H477 handles output F h:b9ectJ W Update handles structure "uidata'h:b9ect, handles(J W UI?6I! ma+es ?elcomeH!oHG5H477 wait &or user response 'see UIG>7UM>( W uiwait'handles &i"ure1(J W [ :utputs &rom this &unction are returned to the command line &unction varar"out F ?elcomeH!oHG5H477H:utput0cn'h:b9ect, eventdata, handles( W varar"out cell array &or returnin" output ar"s 'see Q6G6GG:U!(J

W h:b9ect handle to &i"ure W eventdata reserved = to be de&ined in a &uture version o& M6!.6* W handles structure with handles and user data 'see GUI46!6( W Get de&ault command line output &rom handles structure varar"outY1Z F handles outputJ W [ >#ecutes on button press in 3>R!Hbutton1 &unction 3>R!Hbutton1H2allbac+'h:b9ect, eventdata, handles( open G5H477 &i" close ?elcomeH!oHG5H477J W is this the correct way to lin+ between the inter&ace@ W h:b9ect handle to 3>R!Hbutton1 'see G2*:( W eventdata reserved = to be de&ined in a &uture version o& M6!.6* W handles structure with handles and user data 'see GUI46!6( 4C on 1* 4o' 200" at 2#3/ p% $+.exter
8)& 81& "inse t !ode he e 82& "" Data A!Puisition and Anal0sis using $AIAAB 8+& " $AIAAB suppo ts data a!Puisition using the Data A!Puisition Ioolbox& 87& " Ihis !ode exa(ple sho%s 0ou ho% to easil0 a!Pui e and anal0>e data in 88& " $AIAAB& Uses $AIAAB to a!Pui e t%o se!onds of sound data f o( a 89& " sound !a d# !al!ulate the f ePuen!0 !o(ponents# and plot the esults& 8:& " Bee note belo% on ho% to easil0 update this exa(ple to use diffe ent 8;& " suppo ted data a!Puisition ha d%a e& 8<& " 9)& "" Fote. Auto(ati!all0 gene ating a epo t in $AIAAB 91& " P ess the QBa'e and Publish to JI$AQ button in the $AIAAB @dito to 92& " exe!ute this exa(ple and auto(ati!all0 gene ate a epo t of this %o k& 9+& " 97& "" Btep 1. C eate an analog input ob6e!t to !o((uni!ate %ith data a!Puisition de'i!e 98& " In this !ase# a Cindo%s sound !a d is used (2%insound2)& 99& ai - analoginput(2%insound2)/ 9:& add!hannel(ai#1)/ 9;& 9<& "" Btep 2. Configu e the analog input to a!Pui e 2 se!onds of data at ;)))J> :)& Ds - ;)))/ :1& du ation - 2/ :2& set (ai# 2Ba(pleGate2# Ds)/ :+& set (ai# 2Ba(plesPe I igge 2# du ationRDs)/ :7& :8& "" Btep +. Bta t the a!Puisition and et ie'e the data :9& sta t(ai)/ ::& data - getdata(ai)/ :;&

:<& ;)& ;1& ;2& ;+& ;7& ;8& ;9& ;:& ;;& ;<& <)&

"" Btep 7. Dete (ine the f ePuen!0 !o(ponents of the data xfft - abs(fft(data))/ (ag - 2)Rlog1)(xfft)/ (ag - (ag(1.endS2)/ plot((ag)/ "" Btep 8. Clean up delete(ai)/ !lea ai

"" Fote. Using diffe ent data a!Puisition ha d%a e " Ihe Data A!Puisition Ioolbox enables 0ou to easil0 s%it!h ha d%a e <1& " f o( a sound !a d to anothe suppo ted data a!Puisition de'i!e %ith <2& " (ini(al !hanges to 0ou $AIAAB s! ipt& Ihis exa(ple !ould be epeated <+& " using diffe ent ha d%a e b0 si(pl0 !hanging t%o lines of !ode& Do <7& " exa(ple# if %e %e e to use a Fational Inst u(ents (ultifun!tion !a d <8& " then %e !ould ! eate the analog input ob6e!t using. <9& " ai-analoginput(2nidaP2#1)/ <:& " add!hannel(ai#)) <;& " <<& " Aike%ise# if %e %e e to use a $easu e(ent Co(puting ($CC) boa d to 1))& " a!Pui e the data# the !ode %ould ead. 1)1& " ai-analoginput(2(!!2#;)/ 1)2& " add!hannel(ai#1) 1)+& " 1)7& " Ihe Data A!Puisition Ioolbox suppo ts ha d%a e f o( (an0 (anufa!tu e s 1)8& " in!luding Ad'ante!h# C5FI@C# Data I anslation# and othe s& 1)9& " Do a list of suppo ted data a!Puisition ha d%a e# 'isit. 1):& " http.SS%%%&(ath%o ks&!o(Sp odu!tsSsuppo tedio&ht(lN p odCode-DA 1);& " 1)<& " Io use $AIAAB %ith inst u(ents o se ial de'i!es# 'isit. 11)& " http.SS%%%&(ath%o ks&!o(Sp odu!tsSinst u(ent 111& " 112& " Io use $AIAAB %ith i(aging de'i!es# 'isit. " http.SS%%%&(ath%o ks&!o(Sp odu!tsSi(aP 113 on 17 4o' 200" at 2#2/ a% *0!ali,a

4ear sir 6ll the tutorials are very help&ull to me than+ you sir 114 on 17 4o' 200" at 2#3$ a% *1!ali,a 4ear sir 6t the moment Im an I! Under"raduate so this is my &inal year ?e have to do a Gesearch so our "roup member &ind topics such as &ace recor"oni$ation system,character recor"oni$ation system *ut our lecture pannel say those common topics so could provide some topics &or me

115

on 2$ 4o' 200" at "#3" p% *2&ictor Qery nice tutorial I am doin" a GUI &or a presentation ate university and i have to plot 5 di&&erent ima"es I put at the &i" the 5 a#is, but i would li+e to +now how can i plot a ima"e at an speci&ic a#es >" I want to plot the &i"ure car 9p" at a#es1 and plate 9p" at a#es5 I tried imshow but the ima"es were plot only at the last a#es ' a#es5( !han+s

116 Qictor, use

on 2$ 4o' 200" at "#$0 p% *3Quan Quach

axes(handles&axes1) "set the !u "no% use the i(sho% !o((and

ent axes to axes 1

Euan 11on 2* 4o' 200" at 7#2/ p% *$&ictor !han+s Euan i 68ve another %uestion I have 5 a#es to show 5 di&&erent ima"es, but 3 o& them depends on parameters that i choose at pop up menu to be shown 7o how can i clear the ima"e at the a#is when i chan"e to a parameter that i don\t need those 3 ima"es 4oes e#ist a command li+e clear'handles a#es1(@ 7ee ya// 11< on 22 0ec 200" at 3#3* p% **Sath,a Qictor, cla is used to clear the current a#es 11C on 2+ 0ec 200" at "#*3 p% */2er%an 8i, !han# &or the tutorials S the webpa"e, it)s really clear S this isn)t the only tutorial that i)ve read and develop *ut, here my %uestion i)m doin" a GUI that letme plot one &rame o& a 3d ob9ect in a &i" out &rom the GUI, but now i want to plot another &rame o& the ob9ect in the same &i" but that

&rame "ets plotted into the GUI and not in the &i" i was tryin" with "ca, "co, "cba, S "cbo but this doesn)t wor+ or i)m not applyin" &ine this orders here)s the code o& the plot pushbutton, her i char"e three matrices o& the same si$e called # y $ chec+bo#2 is &or the plottin" o& the opposite U&rameV edit1 is where the person type the number o& the &rame the number o& &rames are the number o& &iles
" 111 @xe!utes on button p ess in pushbutton2& fun!tion pushbutton2_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to pushbutton2 (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) global !o te x 0 > opt-get(handles&!he!kbox2#2Oalue2)/ nst -get(handles&edit1#2Bt ing2)/ *stn(b !,-si>e(x)/ n-st 2double(nst )/ oposite-(stn(bS2)Tn/ if !o te--) xn-x(n#.)/ 0n-0(n#.)/ >n->(n#.)/ figu e# plot+(xn#0n#>n#2&2#2$a ke Bi>e2#9) if opt -- 1 xo-x(oposite#.)/ 0o-0(oposite#.)/ >o->(oposite#.)/ hold on plot+(xo#0o#>o#2&2#2$a ke Bi>e2#9) end elseif !o te--1 *fil !ol,-si>e(x(.))/ x-x(.)/ 0-0(.)/ >->(.)/ !-1/ fo !on-1.fil# if >(!on#1)n xn(!#1)-x(!on#1)/ 0n(!#1)-0(!on#1)/ >n(!#1)->(!on#1)/ !-!T1/ else end end >(-nRones(!11#1)/ figu e# plot+(xn#0n#>(#2&2#2$a ke Bi>e2#9) end guidata(h5b6e!t#handles)/

!han# &or the attention 8erman,

57 I& u want i can sent you the entire GUI 12, on 1* !an 200+ at *#2* p% *7Paolo 8i, &irst than+ you &or this "olden tutorialA I)ve a little problemA I don)t understand why my &irst plot is in a#es1 but the second one isn)t on the "ui in a#es 2 but appear in a windows li+e a normal matlab &ile m please help meA My m &ile isn)t lin+ed to the tutorial but the ar"ument is the same; W [ >#ecutes on button press in pushbutton1 &unction pushbutton1H2allbac+'h:b9ect, eventdata, handles( W h:b9ect handle to pushbutton1 'see G2*:( W eventdata reserved = to be de&ined in a &uture version o& M6!.6* W handles structure with handles and user data 'see GUI46!6( WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW a F "et'handles edit1,)7trin")(J b F "et'handles edit2,)7trin")(J W a and b are variables o& 7trin"s type, and need to be converted W to variables o& 3umber type be&ore they can be added to"ether total F 1O''1='str2num'b((M2(M2B'2N'str2num'a((N'str2num'b(((M2(M'1O2(J c F num2str'total(J W need to convert the answer bac+ into 7trin" type to display it set'handles te#t3,)7trin"),c(J "uidata'h:b9ect, handles(J WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW W [ >#ecutes on button press in pushbutton2 &unction pushbutton2H2allbac+'h:b9ect, eventdata, handles( W h:b9ect handle to pushbutton2 'see G2*:( W eventdata reserved = to be de&ined in a &uture version o& M6!.6* W handles structure with handles and user data 'see GUI46!6( WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW Wselects a#es1 as the current a#es, so that WMatlab +nows where to plot the data a#es'handles a#es1( $F,;, 25;1J &or 9F1;len"th'$(J &or i F 1; 2,1 r'i( F 'i=1(O1,,J d1F''1=r'i(M2(M2B'2N$'1,9(Nr'i((M2(M'1O2(J i& d1]F, &'i,9(F1O''1=r'i(M2(M2B'2N$'1,9(Nr'i((M2(M'1O2(J else

end end end plot'r,&( "rid a#is'K,,1,,,5L( #label')rX( ylabel')&'r()( title')6ndamento della &un$ione di tras&erimento)( le"end')$F,^,)$F, 25^,)$F, 5^,)$F, -5^,)$F1^( "uidata'h:b9ect, handles(J Wupdates the handles WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW W [ >#ecutes on button press in pushbutton3 &unction pushbutton3H2allbac+'h:b9ect, eventdata, handles( W h:b9ect handle to pushbutton3 'see G2*:( W eventdata reserved = to be de&ined in a &uture version o& M6!.6* W handles structure with handles and user data 'see GUI46!6( WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW Wthese two lines o& code clears both a#es cla'handles a#es1,)reset)( cla'handles a#es2,)reset)( "uidata'h:b9ect, handles(J Wupdates the handles WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW W [ >#ecutes on button press in pushbutton4 &unction pushbutton4H2allbac+'h:b9ect, eventdata, handles( W h:b9ect handle to pushbutton4 'see G2*:( W eventdata reserved = to be de&ined in a &uture version o& M6!.6* W handles structure with handles and user data 'see GUI46!6( WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW Wselects a#es2 as the current a#es, so that WMatlab +nows where to plot the data a#es'handles a#es2( $FK,,, 5,, 6,, 65,, -,, -5,1LJ &or 9F1;len"th'$(J &or i F 1; 1,, r'i( F 'i=1(O1,,J d2F''1=r'i(M2(M2B'2N$'1,9(Nr'i((M2(M'1O2(J i& d2]F, &'i,9(F1O''1=r'i(M2(M2B'2N$'1,9(Nr'i((M2(M'1O2(J else end end end &i"ure plot'r,&(

"rid a#is'K, 1 , C4 1 ,6L( title')6ndamento della &un$ione di tras&erimento)( #label')rX( ylabel')&'r()( le"end')$F,^,)$F, 5^,)$F, 6^,)$F, 65^,)$F, -^,)$F, -5^,)$F1^( "uidata'h:b9ect, handles(J Wupdates the handles the problem is lin+ed to the last plot, the &isrt wor+ per&ectly/ than+ you &riends/ 5aolo 121 on 1* !an 200+ at *#3$ p% *"Paolo :ps i)ve understand the problemA the problem was U&i"ureVA 122 on 07 eb 200+ at 2#2" a% *+ro, !his is "reat/ 123 on 12 eb 200+ at *#10 p% /0-ohtet !han+ you &or the ama$in" tutorial, it is a "reat help &or someone as new to this as me 8owever, I had the &ollowin" issue when I try to run your code on my computer 'I 9ust downloaded your a#es $ip (; whenever I clic+ a button I "ot the error; @@@ 6ttempt to re&erence &ield o& non=structure array >rror in FF_ a#esHtutorial_plot1HpushbuttonH2allbac+ at <1 a#es'handles a#es1( >rror in FF_ "uiHmain&cn at C6 &eval'varar"inY;Z(J >rror in FF_ a#esHtutorial at 42 "uiHmain&cn'"uiH7tate, varar"inY;Z(J @@@ >rror while evaluatin" uicontrol 2allbac+ is this related to my matlab version@ 'I am usin" G2,,<b( than+s ahed/ 124 on 12 eb 200+ at *#30 p% /1-ohtet 6h nevermind; I was tryin" to run the N &i", instead o& N m &ile, silly me 125 on 1* eb 200+ at /#2/ a% /2barne,

8i, than+s &or this tutorial it helps me a lot 3ow I have this issue, I load # and y coordinates to be plotted in the a#es ob9ect 0ollowin" this tutorial it is %uite easy, I use the load command to read the data &rom, &or e#ample, #Hcoor t#t and yHcoor t#t assi"nin" them to the variables # and y 0inally I plot the &irst column o& the # and y vector *ut what I need to do i& I want to update the plot with &or e#ample the value o& the second column o& the two vector I)d li+e to avoid to re=load each time the two &iles because they are hu"e &iles with several column and it re%uires some minutes to be loaded@ 8ow is it possible to store the two matrices '# and y( in to the wor+space and then access them each time i press the bottom to update the "raph with the ne#t column@ I hope it is clear, than+s bye 126 on 1/ eb 200+ at +#*+ a% /38ane -ontgo%er, 8i *arney, ?hat I thin+ you)re loo+in" &or is a command to access a certain column o& your matri# It sounds li+e you +now how to load the data &or your #,y coordinates 8ope&ully you can load the whole &ile into some variables RHtotal, 1Htotal 'or whatever you want to call them( !hen to access the speci&ic column, use this sort o& command;
x_te(p-3_total(.#1) !olu(n x_te(p 0_te(p-4_total(.#1) o% "sto es e'e 0 o% (2!olon2) of the 1st " f o( 3_total into " (1#.) %ould get e'e 0 !olu(n of the fi st

8ope&ully that)s what you)re loo+in" &or =`ane 12on 1/ eb 200+ at 10#$3 p% /$e'ilstar'irus !han+s a lot &or all the tuto 12< on 20 eb 200+ at 3#*+ a% /*(arne, 8i `ane, actually my problem was to store the data in a variable that can be manipulated each time a press a button or so on, so basically is a problem o& variable visibilityA I)ve solved the problem usin" assi"nin and evalin command to store the data in the Dbase) wor+space) May be there is a more ele"ant solution but that is what I &ind out !han+s `ane

*ye 12C on 21 eb 200+ at 12#$$ a% //barne, 8i "uys, another %uestion, is it possible to introduce a +nob in a matlab GUI@ I as+ed this %uestion because in the layout editor there is not any command li+e this one 5lease let me +ow i& it is possible !han+s 13, 8i, ?ent throu"h your tutorials !hey helped me a lot Ge&erin" to your e#ample o& plottin" data to the a#es ?hat i& we de&ine the numerator and the denominator in the &orm o& a matri# and plot usin" the &unction bode'den,num( instead ,& plot'#,y( My re%uirement is to plot the trans&er &unction obtained &rom t&'num,den( &ormat *y usin" the above plot &unction bode'num,den( i dont "et any display in my "ui a#es 5lease help me to sort this problem
a-st 2nu((get(handles&edit#2st ing2))/ b-st 2nu((get(handles&edit1#2st ing2))/ !-st 2nu((get(handles&edit2#2st ing2))/ d-st 2nu((get(handles&edit+#2st ing2))/ e-st 2nu((get(handles&edit7#2st ing2))/ nu(-*a b ! d e,/ h-st 2nu((get(handles&editden1#2st i-st 2nu((get(handles&editden2#2st 6-st 2nu((get(handles&editden+#2st k-st 2nu((get(handles&editden7#2st l-st 2nu((get(handles&editden8#2st den-*h i 6 k l,/ ing2))/ ing2))/ ing2))/ ing2))/ ing2))/

on 2* eb 200+ at +#10 a% /7hashan

"plots the x and 0 data bode(nu(#den)/ "adds a title# x1axis des! iption# and 01axis des! iption title(2Axes 12)/ xlabel(23 data2)/ 0label(24 data2)/ 131 on 2* eb 200+ at +#12 a% /"Quan Quach

hashan, 4id you set the a#es@ Euan 132 on 2/ eb 200+ at 12#12 a% /+hashan

8i, 2an you please "uide me to set the a#es :r can you place a lin+ which i can learn how to set the a#es th# 4 respondin" hashan 133 on 2/ eb 200+ at 12#13 a% 70Quan Quach 8ashan, 7ee step 1, in the section called; ?ritin" the 2ode &or the GUI Euan 134 on 2" eb 200+ at 11#20 a% 710aniel Suto,o I barney; 4on)t believe there is a +nob, closest thin" to it is the slider I "uess there are usability issues when you have a +nob that you have to rotate 4e&initely doable and code=able 135 hi, I have a problem that I want to draw parallel coordinate plots usin" M6!.6* I am usin" M6!.6* - , I want to set di&&erent scale &or ya#is so that 46!6 should be understandable 2an you help me in that re"ard 136 on 1* -ar 200+ at +#1+ a% 73cugo 8i, I did all the steps but when I press the &unction icon on the tool bar it doesnt brin" the callbac+ &unctions I chec+ed the ta"s li+e 3 times 4oes anyone have an idea@ 13on 17 -ar 200+ at 2#30 a% 7$%itra hi tn# alot &or all the "uide/ its so use&ul but i have the same problem as hashan i thin+ GUI cant show the bode dia"ram in a#es is there any way,other than usin" plot &or the bode@ 13< on 17 -ar 200+ at /#*1 a% 7*8ane -ontgo%er, I 6nil It sounds li+e you either want to use plotyy or subplot &eatures on 13 -ar 200+ at "#11 p% 72Anil

type Ddoc plotyy) or Ddoc subplot) in the command window to see how they)re used I mitra I don)t have bode &eature on this computer, but I)ve used it be&ore 8ope&ully 9ust plottin" '2,Nlo"1,'abs'!0(( isn)t too bad *ut you could try playin" around with "c&O"etOset commands a&ter ma+in" the bode plot to reconstruct your own plot &rom the bode dia"ram 'i& it has manipulatable a#es( =`ane 13C Euan, Qery nice tutorial I have a similar "ui, e#cept that one o& the plots is a 34 plot ?hen I try to $oom in on that 34 plot it "rows until it &ills the entire &i"ure !his behavior is undesireable I would not li+e &or anythin" outside o& the a#es boundary to be displayed I tried several ways to &i# this with no success I tried ma+in" sure that the Dclippin") property &or the &i"ure was set to Don) I also tried puttin" this a#es in uipanel whose Dclippin") property was set to Don) 4o you have a solution &or this problem@ !han+s in advance &or any help you can provide =7eth 14, on 17 -ar 200+ at +#3/ p% 77ishan sir,i want to display various si"nal on "ui usin" matlab 141 on 22 -ar 200+ at 11#32 p% 7"5ick !o 8ashan S Mitra, 2han"e !ools=_GUI :ptions=_Gesi$e *ehavior to 5roprotional !ry a"ain 142 on 2/ -ar 200+ at $#$0 a% 7+%itra 4ear Gic+ It wor+ed///I dont +now how to than+ you,you 9ust made my day // Mitra 143 on 01 Apr 200+ at /#$/ a% "0-iguel !han+ you very much &or the tutorial, it)s really "ood on 17 -ar 200+ at 2#*+ p% 7/Seth

144 8ello

on 1* Apr 200+ at +#01 p% "1Christina

I am tryin" to ma+e a plot and I want my y=value to be the strin" value comin" &rom a di&&erent static te#t bo# I tried usin" yF"et'handles resultHedit!e#t,)7trin")(J but that does not wor+ ?hat is the code &or this@ !han+s//// 2hristina 145 on 1/ Apr 200+ at /#*1 a% "28ane -ontgo%er, 2hristina, 1ou won)t be able to plot )strin") values, so you need to convert them to Ddouble) &ormat &irst
0-st 2double(get(handles& esult_editIext#UBt ingU))/

=`ane 146 on 2/ Apr 200+ at 11#3/ p% "35o, 8i, may i as+ u a %uestion about plottin" on a#es I need to display my chromosome ideo"ram on a a#es o& GUI I have tried the way u described above, but it doesnt wor+ !8e result is still a blan+ a#es, the ideo"ram were not doc+ed in the a#es 0ollowin"s are my codes ;
fun!tion pushbutton1_Callba!k(h5b6e!t# e'entdata# handles) sa(ple1-st u!t(2Ch o(oso(e2#*1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 + + + + + + + + + + + 7 7 7 7 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 : : : : : &&& ; ; ; ; ; ; ; ; < < < < < < 1) 1) 1) 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 1+ 1+ 1+ 17 17 18 18 18 18 18 19 19 19 19 19 19 &&& 1: 1: 1: 1: 1: 1: 1: 1: 1; 1; 1; 1; 1; 1; 1; 1< 1< 1< 2) 2) 2) 21 21 22 22 22 2+ 2+ 2+ 2+,#2CFOI0pe2#*2 2 1 1 2 1 2 2 2 2 1 2 &&& 2 1 2 2 2 &&& 2 2 1 2 2 2 2 2 2 2 2 &&& 1 1 2 2 2 2 2 2 2 &&& 1 1 1 2 1 &&& 2 2 2 2 2 1 1 1 2 1 &&& 2 2 2 2 1 &&& 1 2 1 2 2 1 1 1 &&& 1 2 1 1 1 1 &&& 1 2 1 &&& 1 1 1 1 1 2 1 1 &&& 1 1 1 1 1 1 1 &&& 1 1 1 &&&

2 2 &&& 2 2 2 2 2 &&& 2 1 1 1 1 1 &&& 2 2 1 2 1 2 1 1 &&& 1 1 1 1 1 1 1 &&& 2 2 2 &&& 2 1 2 &&& 1 1 &&& 2 2 2 &&& 2 2 2 2,#2Bta t2#&&& *B&Beg(entData(1)&Bta t/ B&Beg(entData(2)&Bta t/ B&Beg(entData(+)&Bta t/ B&Beg(entData(7)&Bta t/ B&Beg(entData(8)&Bta t/ B&Beg(entData(9)&Bta t/ &&& B&Beg(entData(:)&Bta t/ B&Beg(entData(;)&Bta t/ B&Beg(entData(<)&Bta t/ B&Beg(entData(1))&Bta t/ B&Beg(entData(11)&Bta t/ B&Beg(entData(12)&Bta t/ &&& B&Beg(entData(1+)&Bta t/ B&Beg(entData(17)&Bta t/ B&Beg(entData(18)&Bta t/ B&Beg(entData(19)&Bta t/ B&Beg(entData(1:)&Bta t/ B&Beg(entData(1;)&Bta t/ &&& B&Beg(entData(1<)&Bta t/ B&Beg(entData(2))&Bta t/ B&Beg(entData(21)&Bta t/ B&Beg(entData(22)&Bta t/ B&Beg(entData(2+)&Bta t,#2@nd2#&&& *B&Beg(entData(1)&@nd/ B&Beg(entData(2)&@nd/ B&Beg(entData(+)&@nd/ B&Beg(entData(7)&@nd/ B&Beg(entData(8)&@nd/ B&Beg(entData(9)&@nd/ B&Beg(entData(:)&@nd/ &&& B&Beg(entData(;)&@nd/ B&Beg(entData(<)&@nd/ B&Beg(entData(1))&@nd/ B&Beg(entData(11)&@nd/ B&Beg(entData(12)&@nd/ B&Beg(entData(1+)&@nd/B&Beg(entData(17)&@nd/ &&& B&Beg(entData(18)&@nd/ B&Beg(entData(19)&@nd/ B&Beg(entData(1:)&@nd/ B&Beg(entData(1;)&@nd/ B&Beg(entData(1<)&@nd/ B&Beg(entData(2))&@nd/ &&& B&Beg(entData(21)&@nd/ B&Beg(entData(22)&@nd/ B&Beg(entData(2+)&@nd,)/ axes(handles&axes1)/ !h o(oso(eplot(2hs_!0toBand&txt2#2!n'2#sa(ple1#2unit2#2)/ guidata(h5b6e!t# handles)/

2an u help me troubleshoot this codes !han+s/// 14on 27 Apr 200+ at 7#3$ a% "$8ane -ontgo%er, Goy, since you)re not usin" one o& the M6!.6* de&ault plottin" commands, I don)t thin+ we)ll be able to help you It loo+s li+e your Dchromosomeplot) &unction is what you)re usin" to plot 1ou may want to loo+ into havin" chromosomeplot output plot data into your GUI e " K#1,#2, ,y1,y2LFchromosomeplot')hsHcyto*and t#t),Xcnv),sample1,)unit),2(J 6nd then plot it manually in the GUI &ollowin" the e#ample in this tutorial 1ou will need to +now how the code wor+s to use those outputs and may need to setup the outputs i& it doesn)t have them yet Good luc+/

14<

on 27 Apr 200+ at "#0/ a% "*Sa% 8ello Guys, 6nyone +nows how to add a readme t#t to a a customi$ed tool bar I created a toolbar button called U6boutV and a sub lin+ called UGeadmeV ?hat I wish to do is to have a t#t &ile lin+ed to the readme tabAthan#

14C

on 2+ Apr 200+ at $#1$ a% "/Toon 1ou are my personal hero/

15,

on 0* -a, 200+ at 12#$* a% "75o, !han+s &or the previous help *ut i still can)t wor+ out the solution It)s o+ , I)m con&usin" about one %uestion now, which is about GUI in matlab I need to creat some subpanels in a main panel I step up the subpanels ?hen I pro"ram the GUI, I set the DQisible) property o& &ist subpanel to Do&&), it will result in that I cant acess the rest o& subpanels what is the solution &or containin" some subpanels with steppin" up one another in a main panel !han+s

151

on 0/ -a, 200+ at 3#*$ p% ""east%us than+s &or these "reat tutorials Euan Euach Ive been loo+in" throu"h the GUI tutorials but i seem to be stuc+ at some code I have a Dnormal) m=&ile 'not GUI( and that wor+s &ine, I am tryin" to put this script in a GUI, but i am "ettin" lots o& errors and I cant &i"ure it out !he wor+in" m &ile script
Ub-1) D eP-1))) G-1))) C-)&)))))1 I-*).)&))1.)&)1, I2-*)&)1.)&))1.)&)2, GC-GRC U!-UbR(11exp(1(IS(GC)))) U -UbRexp(1(ISGC)) U!2-U!(11)Rexp(1(ISGC)) U 2-1U!(11)Rexp(1(ISGC)) ub(at-*1) 1) 1) 1) 1) 1) 1) 1) 1) 1) 1)#) ) ) ) ) ) ) ) ) ) ), ubI-*I#I2, plot(I#U!#2g2)#g id hold on plot(I#U ) plot(ubI#ub(at#2 2) plot(I2#U!2#2g2) plot(I2#U 2) hold off h - legend(2U!2#2U 2#2Ub2#1)/ set(h#2Inte p ete 2#2none2)

title(2oplading en ontlading 'an de !ondensato

'an 1 pe iode2)

!he GUI script


fun!tion 'a a gout - untitled('a a gin) " UFIIIA@D $1file fo untitled&fig " UFIIIA@D# b0 itself# ! eates a ne% UFIIIA@D o aises the existing " singletonR& " " J - UFIIIA@D etu ns the handle to a ne% UFIIIA@D o the handle to " the existing singletonR& " " UFIIIA@D(2CAAABACE2#h5b6e!t#e'entData#handles#&&&) !alls the lo!al " fun!tion na(ed CAAABACE in UFIIIA@D&$ %ith the gi'en input a gu(ents& " " UFIIIA@D(2P ope t02#2Oalue2#&&&) ! eates a ne% UFIIIA@D o aises the " existing singletonR& Bta ting f o( the left# p ope t0 'alue pai s a e " applied to the GUI befo e untitled_5peningD!n gets !alled& An " un e!ogni>ed p ope t0 na(e o in'alid 'alue (akes p ope t0 appli!ation " stop& All inputs a e passed to untitled_5peningD!n 'ia 'a a gin& " " RBee GUI 5ptions on GUID@2s Iools (enu& Choose QGUI allo%s onl0 one " instan!e to un (singleton)Q& " " Bee also. GUID@# GUIDAIA# GUIJAFDA@B " @dit the abo'e text to (odif0 the esponse to help untitled

" Aast $odified b0 GUID@ '2&8 ):1$a012))< )1.):.8: " Begin initiali>ation !ode 1 D5 F5I @DII gui_Bingleton - 1/ gui_Btate - st u!t(2gui_Fa(e2# (filena(e# &&& 2gui_Bingleton2# gui_Bingleton# &&& 2gui_5peningD!n2# Muntitled_5peningD!n# &&& 2gui_5utputD!n2# Muntitled_5utputD!n# &&& 2gui_Aa0outD!n2# *, # &&& 2gui_Callba!k2# *,)/ if na gin Ha(p/Ha(p/ is!ha ('a a ginK1L) gui_Btate&gui_Callba!k - st 2fun!('a a ginK1L)/ end if na gout *'a a goutK1.na goutL, - gui_(ainf!n(gui_Btate# 'a a ginK.L)/ else gui_(ainf!n(gui_Btate# 'a a ginK.L)/ end " @nd initiali>ation !ode 1 D5 F5I @DII

" 111 @xe!utes 6ust befo e untitled is (ade 'isible& fun!tion untitled_5peningD!n(h5b6e!t# e'entdata# handles# 'a a gin) " Ihis fun!tion has no output a gs# see 5utputD!n& " h5b6e!t handle to figu e " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " 'a a gin !o((and line a gu(ents to untitled (see OAGAGGIF) " Choose default !o((and line output fo handles&output - h5b6e!t/ " Update handles st u!tu e guidata(h5b6e!t# handles)/ " UICAII (akes untitled %ait fo " ui%ait(handles&figu e1)/ use esponse (see UIG@BU$@) untitled

" 111 5utputs f o( this fun!tion a e etu ned to the !o((and line& fun!tion 'a a gout - untitled_5utputD!n(h5b6e!t# e'entdata# handles) " 'a a gout !ell a a0 fo etu ning output a gs (see OAGAGG5UI)/ " h5b6e!t handle to figu e " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " Get default !o((and line output f o( handles st u!tu e 'a a goutK1L - handles&output/

" fun!tion a(p_edit_txt_Callba!k(h5b6e!t# e'entdata# handles) " " h5b6e!t handle to a(p_edit_txt (see GCB5) " " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " " handles st u!tu e %ith handles and use data (see GUIDAIA) " " " Jints. get(h5b6e!t#2Bt ing2) etu ns !ontents of a(p_edit_txt as text " " st 2double(get(h5b6e!t#2Bt ing2)) etu ns !ontents of a(p_edit_txt as a double " input - st 2double(get(h)b6e!t#2st ing2))/ " " if (ise(pt0(input)) " set(h5b6e!t#2st ing2#2)2) " end " guidata(h5b6e!t#handles)/ " " " 111 @xe!utes du ing ob6e!t ! eation# afte setting all p ope ties& " fun!tion a(p_edit_txt_C eateD!n(h5b6e!t# e'entdata# handles) " " h5b6e!t handle to a(p_edit_txt (see GCB5) " " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB

" " handles e(pt0 1 handles not ! eated until afte all C eateD!ns !alled " " " Jint. edit !ont ols usuall0 ha'e a %hite ba!kg ound on Cindo%s& " " Bee IBPC and C5$PUI@G& " if isp! Ha(p/Ha(p/ isePual(get(h5b6e!t#2Ba!kg oundColo 2)# get()#2defaultUi!ont olBa!kg oundColo 2)) " set(h5b6e!t#2Ba!kg oundColo 2#2%hite2)/ " end

fun!tion f eP_edit_txt_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to f eP_edit_txt (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " Jints. get(h5b6e!t#2Bt ing2) etu ns !ontents of f eP_edit_txt as text " st 2double(get(h5b6e!t#2Bt ing2)) etu ns !ontents of f eP_edit_txt as a double input - st 2double(get(h5b6e!t#2st ing2))/ if (ise(pt0(input)) set(h5b6e!t#2st ing2#21)))2) end guidata(h5b6e!t#handles)/ " 111 @xe!utes du ing ob6e!t ! eation# afte setting p ope ties& fun!tion f eP_edit_txt_C eateD!n(h5b6e!t# e'entdata# " h5b6e!t handle to f eP_edit_txt (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e $AIAAB " handles e(pt0 1 handles not ! eated until afte C eateD!ns !alled all handles) sion of all

" Jint. edit !ont ols usuall0 ha'e a %hite ba!kg ound on Cindo%s& " Bee IBPC and C5$PUI@G& if isp! Ha(p/Ha(p/ isePual(get(h5b6e!t#2Ba!kg oundColo 2)# get()#2defaultUi!ont olBa!kg oundColo 2)) set(h5b6e!t#2Ba!kg oundColo 2#2%hite2)/ end

fun!tion _edit_txt_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to _edit_txt (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " Jints. get(h5b6e!t#2Bt ing2) etu ns !ontents of _edit_txt as text " st 2double(get(h5b6e!t#2Bt ing2)) etu ns !ontents of _edit_txt as a double input - st 2double(get(h5b6e!t#2st ing2))/

if (ise(pt0(input)) set(h5b6e!t#2st ing2#21)))2) end guidata(h5b6e!t#handles)/ " 111 @xe!utes du ing ob6e!t ! eation# afte setting all p ope ties& fun!tion _edit_txt_C eateD!n(h5b6e!t# e'entdata# handles) " h5b6e!t handle to _edit_txt (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles e(pt0 1 handles not ! eated until afte all C eateD!ns !alled " Jint. edit !ont ols usuall0 ha'e a %hite ba!kg ound on Cindo%s& " Bee IBPC and C5$PUI@G& if isp! Ha(p/Ha(p/ isePual(get(h5b6e!t#2Ba!kg oundColo 2)# get()#2defaultUi!ont olBa!kg oundColo 2)) set(h5b6e!t#2Ba!kg oundColo 2#2%hite2)/ end

fun!tion !_edit_txt_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to !_edit_txt (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " Jints. get(h5b6e!t#2Bt ing2) etu ns !ontents of !_edit_txt as text " st 2double(get(h5b6e!t#2Bt ing2)) etu ns !ontents of !_edit_txt as a double input - st 2double(get(h5b6e!t#2st ing2))/ if (ise(pt0(input)) set(h5b6e!t#2st ing2#2)&)))))12) end guidata(h5b6e!t#handles)/ " 111 @xe!utes du ing ob6e!t ! eation# afte setting all p ope ties& fun!tion !_edit_txt_C eateD!n(h5b6e!t# e'entdata# handles) " h5b6e!t handle to !_edit_txt (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles e(pt0 1 handles not ! eated until afte all C eateD!ns !alled " Jint. edit !ont ols usuall0 ha'e a %hite ba!kg ound on Cindo%s& " Bee IBPC and C5$PUI@G& if isp! Ha(p/Ha(p/ isePual(get(h5b6e!t#2Ba!kg oundColo 2)# get()#2defaultUi!ont olBa!kg oundColo 2)) set(h5b6e!t#2Ba!kg oundColo 2#2%hite2)/ end fun!tion ub_edit_txt_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to ub_edit_txt (see GCB5)

" e'entdata $AIAAB " handles

ese 'ed 1 to be defined in a futu e 'e sion of st u!tu e %ith handles and use data (see GUIDAIA)

" Jints. get(h5b6e!t#2Bt ing2) etu ns !ontents of ub_edit_txt as text " st 2double(get(h5b6e!t#2Bt ing2)) etu ns !ontents of ub_edit_txt as a double input - st 2double(get(h5b6e!t#2Bt ing2))/ if (ise(pt0(input)) set(h5b6e!t#2Bt ing2#21)2) end guidata(h5b6e!t#handles)/ " 111 @xe!utes du ing ob6e!t ! eation# afte setting all p ope ties& fun!tion ub_edit_txt_C eateD!n(h5b6e!t# e'entdata# handles) " h5b6e!t handle to ub_edit_txt (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles e(pt0 1 handles not ! eated until afte all C eateD!ns !alled " Jint. edit !ont ols usuall0 ha'e a %hite ba!kg ound on Cindo%s& " Bee IBPC and C5$PUI@G& if isp! Ha(p/Ha(p/ isePual(get(h5b6e!t#2Ba!kg oundColo 2)# get()#2defaultUi!ont olBa!kg oundColo 2)) set(h5b6e!t#2Ba!kg oundColo 2#2%hite2)/ end " 111 @xe!utes on button p ess in toepassen_pushbtn& fun!tion toepassen_pushbtn_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to toepassen_pushbtn (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) axes(handles&%ee ga'e)/ Ub-get(handles&ub_edit_txt#2Bt ing2)/ D eP-get(handles&f eP_edit_txt#2Bt ing2)/ G-get(handles& _edit_txt#2Bt ing2)/ C-get(handles&!_edit_txt#2Bt ing2)/ I-*).)&))1.)&)1,/ I2-*)&)1.)&))1.)&)2,/ GC-GRC/ U!-UbR(11exp(1(IS(GC))))/ U -UbRexp(1(ISGC))/ U!2-U!(11)Rexp(1(ISGC))/ U 2-1U!(11)Rexp(1(ISGC))/ ub(at-*1) 1) 1) 1) 1) 1) 1) 1) 1) 1) 1)#) ) ) ) ) ) ) ) ) ) ),/ ubI-*I#I2,/ plot(I#U!#2g2)#g id/ hold on/ plot(I#U )/ plot(ubI#ub(at#2 2)/ plot(I2#U!2#2g2)/ plot(I2#U 2)/ hold off/ h - legend(2U!2#2U 2#2Ub2#1)// set(h#2Inte p ete 2#2none2)/

title(2oplading en ontlading 'an de !ondensato guidata(h5b6e!t#handles)/

'an 1 pe iode2)/

!he error codes


NNN @ o using --Hgt/ (ti(es Inne (at ix di(ensions (ust ag ee& @ o in --Hgt/ untitledHgt/toepassen_pushbtn_Callba!k at 229 GC-get(handles& _edit_txt#2Bt ing2)Rget(handles&!_edit_txt#2Bt i ng2)/ @ @ o o in --Hgt/ gui_(ainf!n at <9 fe'al('a a ginK.L)/ in --Hgt/ untitled at 72 gui_(ainf!n(gui_Btate# 'a a ginK.L)/ o %hile e'aluating ui!ont ol Callba!k

NNN @

!han+s in advance 152 on 07 -a, 200+ at /#*7 a% "+8ane -ontgo%er, >astmus, 1ou are multiplyin" two D7trin"s) by each other when you use the D"et) command and then do; G2FGN2J 7o you)re basically multiplyin" D.>>!) N DG:6G) when you should be multiplyin" 133-N2,42 'words vs numbers( I predict that you)ll "et a &ew errors because o& this, but it can be easily solved
" ne% !ode Ub-st 2double(get(handles&ub_edit_txt#2Bt ing2))/ D eP-st 2double(get(handles&f eP_edit_txt#2Bt ing2))/ G-st 2double(get(handles& _edit_txt#2Bt ing2))/ C-st 2double(get(handles&!_edit_txt#2Bt ing2))/

6s &ar as &indin" errors in the &uture, notice that that was the section o& code that chan"ed &rom your m=&ile to GUI, so it is most li+ely the culprit &or your errors and you can &ocus debu""in" that section 'you can also post 9ust the &unction your havin" issues with instead o& the whole GUI MHM( 153 on 07 -a, 200+ at 7#1+ a% +0east%us than+s a lot `ane I totally &or"ot about str2double, i read this tutorial and the My6dder and combined both these new stu&& are still &resh &or me and its easy &or me to loo+ over them

than+s a"ain, its wor+in" 154 8i, I am doin" this GUI which plots "raphs I am able to have the plot on the main &i"ure with all the inputs 8owever I would li+e to do so that my GUI only ta+es in the inputs and when i press U5lotV the &i"ure pops up in a new window 'li+e what you "et when you do the plot &unction on Matlab( 6ny ideas@ 6nother %uestion is this My GUI actually plots the velocity vectors and the tra9ectory o& 2 di&&erential e%uations I can "et these two plots on the same a#es 8owever I would li+e to do so that when the user clic+s on the plotted "raph o& velocity vectors, it plots the tra9ectory i e "ettin" in&ormation 'initial conditions so that i can plot my tra9ectory( &rom a clic+ on the "raph 8ope you can help me !han+s &or the awesome tutorials 155 on 1$ -a, 200+ at "#02 p% +2-AT7A( 9:; Tutorial < or (eginners = blink)agger K L GUI !utorial = 7lider M6!.6* GUI !utorial = 5op=up Menu M6!.6* GUI !utorial = 5lottin" 4ata to 6#es M6!.6* GUI !utorial = *utton !ypes and *utton Group M6!.6* GUI !utorial = 6 *rie& Introduction to K L 156 hi i am tryin" to &i"ure out how to load a "raph into a a#is , li+e the one you made in your e#ample im not sure how to load it &rom &ile, then put it into the a#es than+s than+s &or the tutorial 15on 27 -a, 200+ at /#0$ a% +$Archana !han+ you Qery well written 15< 8i, I need to use Up$mapV &unction and plot the data in a#es1 2an you help me@ on 2" -a, 200+ at /#2/ a% +*5ui on 1+ -a, 200+ at 11#$0 a% +3barsk on 1$ -a, 200+ at 7#00 a% +1aaron

than+s 15C 8i, I was tryin" to draw some simple wire=&rame polyhedrons with 3d plots and lines but it doesn)t show up properly I drew a tetrahedron with a di&&erent color &or each ed"e 5roblem is, linesOed"es that are suppose to be behind others appear in &ront o& them Is this normal@ Is M6!.6* smart enou"h to determine which lines are suppose to be in &rontObac+@ :r am I not doin" this ri"ht@ 8elp would be very much appreciated !han+s/ 16, on 1$ !un 200+ at 11#01 a% +7,ale3let 1anta I 6M 86551,I7 ?86! I ?:U.4 .IP> !: 761 U 2:3!I3U> I7 ?86! I 644 I 655G>2I6!> ?86! U)G 2:*!GGI*U!I3G !: *>GI33>G7 161 on 0+ !ul 200+ at /#1/ p% +"5a, 8ello Euan and 4aniel !han+s &or creatin" the best matlab tutorial site I came across the &ollowin" m &ile on the 0ile >#chan"e called G!race m which shows the cursor positions on any plots 5retty nice tool to pimp up a GUI 7tart o& &ile G!race m
fun!tion GI a!e(sele!t) "GIGAC@ G aph t a!ing utilit0 " "Io sta t. !li!k o fo!us the plot 0ou %ant to t a!e# then t0pe GI a!e in $atlab en'i on(ent "Io stop. one !li!k on the plot 0ou2 e t a!ing " "If the e2 e (o e than one plot in an axes# 0ou !an sele!t %hi!h line to t a!e b0 "sele!ting the listbox at the lo%e left !o ne " "Du i Andi Ea napi and Aee Eong Aik "DBP Aab# B!hool of @@@ "Fan0ang Ie!hnologi!al Uni'e sit0 "Bingapo e "$a !h 2))2 if na gin--)/ !u D!n - get(g!f# 2%indo%button(otionf!n2)/ assignin(2base2#2!u D!n2#!u D!n)

on 01 !un 200+ at /#0/ p% +/0an

!u D!n2 - get(g!f# 2%indo%buttondo%nf!n2)/ assignin(2base2#2!u D!n22#!u D!n2) !u Iitle - get(get(g!a# 2Iitle2)# 2Bt ing2)/ assignin(2base2#2!u Iitle2#!u Iitle) handles - guidata(g!a)/ assignin(2base2#2handles2#handles) if (isfield(handles#2ID2) Ha(p/ handles&ID--1) disp(2GI a!e is al ead0 a!ti'e&2)/ etu n/ else handles&ID - 1/ disp(2GI a!e sta ted&2)/ end theDot - text()# )# 2?lefta o%2)/ set(theDot# 2DontCeight2# 2bold2# 2DontBi>e2# 1))/ handles - ! eateAistBox(handles)/ handles&!u D!n - !u D!n/ handles&!u D!n2 - !u D!n2/ handles&!u Iitle - !u Iitle/ handles&theDot - theDot/ handles&theBtate - uisuspend(g!f)/ guidata(g!a# handles)/ set(g!f# 2%indo%button(otionf!n2# 2GI a!e(225n$ouse$o'e22)2)/ set(g!f# 2%indo%buttondo%nf!n2# 2GI a!e(225n$ouseDo%n22)2)/ else s%it!h sele!t !ase 25nAistBoxCallBa!k2 GI a!e_AistBoxCallba!k/ !ase 25n$ouse$o'e2 GI a!e_5n$ouse$o'e/ !ase 25n$ouseDo%n2 GI a!e_5n$ouseDo%n/ end end "111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111 fun!tion *out, - ! eateAistBox(handles) AistBoxPost - *2 2 ;) 7),/ J!_listbox ui!ont ol(g!f#2st0le2#2listbox2#2position2#AistBoxPost)/ line5b6 - findob6(g!a# 2I0pe2# 2line2)/ nu(5fAines - (ax(si>e(line5b6))/ if nu(5fAines Hgt/ ) dispBt ing - 212/ else etu n/ end fo i-2.nu(5fAines dispBt ing - *dispBt ing sp intf(2V"d2#i),/ end

set(J!_listbox#2st ing2#dispBt ing)/ set(J!_listbox#2!allba!k2#2GI a!e(225nAistBoxCallBa!k22)2)/ handles&%hi!h5ne - 1/ handles&AistBox - J!_listbox/ out - handles/ GI a!e_AistBoxCallba!k(J!_listbox)/ "111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111 fun!tion GI a!e_5n$ouse$o'e global xData 0Data/ pt - get(g!a# 2Cu entPoint2)/ xInd - pt(1# 1)/ line5b6 - findob6(g!a# 2I0pe2# 2line2)/ xAi( - get(g!a# 23Ai(2)/ 0Ai( - get(g!a# 24Ai(2)/ nu(5fAines - (ax(si>e(line5b6))/ handles - guidata(g!a)/ %hi!h5ne - handles&%hi!h5ne/ if ((xInd xAi((2)) V (xInd (ax(xData))) title(25ut of 3 li(it2)/ etu n/ end 0Ind - inte p1(xData# 0Data# xInd)/ if ((0Ind 0Ai((2))) title(25ut of 4 li(it2)/ etu n/ end set(handles&theDot# 2Position2# *xInd# 0Ind,)/ title(*2AIF@ 2 nu(2st (%hi!h5ne) 2 of 2 nu(2st (nu(5fAines) 2/ 3 - 2 nu(2st (xInd) &&& 2# 4 - 2 nu(2st (0Ind),)/ "111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111 fun!tion GI a!e_AistBoxCallba!k(aData) global xData 0Data handles - guidata(g!a)/ if (na gin W- 1) handles&%hi!h5ne - get(g!bo#2'alue2)/ else handles&%hi!h5ne - get(aData#2'alue2)/ end %hi!h5ne - handles&%hi!h5ne/ guidata(g!a#handles)/ line5b6 - findob6(g!a# 2I0pe2# 2line2)/ line5b6 - line5b6(%hi!h5ne)/ xData - get(line5b6# 2xData2)/ 0Data - get(line5b6# 20Data2)/ xAi( - get(g!a# 23Ai(2)/

0Ai( - get(g!a# 24Ai(2)/ ePInd - find((xData Hgt/- xAi((1)) Ha(p/ (xData Hlt/xAi((2)))/ if (length( ePInd) Hlt/ 2) "Buppose the use >oo( the data until the ePInd - *, i1 - find(xData xAi((2))/ "Aet the ePInd(2) - the fi st indi!e afte (ax x axis ePInd - *i1(end).i2(1),/ end xData - xData( ePInd)/ 0Data - 0Data( ePInd)/ "111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111 fun!tion GI a!e_5n$ouseDo%n handles - guidata(g!a)/ set(g!f# 2%indo%button(otionf!n2# handles&!u D!n)/ set(g!f# 2%indo%buttondo%nf!n2# handles&!u D!n2)/ title(handles&!u Iitle)/ delete(handles&theDot)/ delete(handles&AistBox)/ ui esto e(handles&theBtate)/ handles&ID-)/ guidata(g!a#handles)/ !lea xData 0Data/ disp(2GI a!e ended&2)/

>nd o& &ile I tried usin" it with plotyy in a matlab "ui 'which I learned to do &rom your site(but can)t seem to "et it to wor+ I am sure you will +now e#actly how to ma+e it wor+ 8ave you written a similar tool be&ore that you can share@ !han+s &or postin" all the "reat matlab tips = Gay 162 on 23 !ul 200+ at 10#3/ p% ++>?@ awesome// easy , %uic+, help&ul 163 on 2$ !ul 200+ at 2#*7 a% 100Sa'itha I am wor+in" on &ace reco"nition pro9ect, I have the source code ready,now i want to create the inter&ace I don)t +now how to load ima"es into the inter&ace I have many &i"ure windows a&ter the code e#ecutes,how do i connect them to the inter&ace 5lease su""est !han+ u 164 on 01 Sep 200+ at 11#02 a% 101 rank !han+s a lot/ 1our tutorials made me understand GUI)s so now I can ma+e my own/

165

on 0" Sep 200+ at 1#0$ a% 102coolAatB !han+s &or this "uide /// It)s Great /// MHM

166

on 22 Sep 200+ at 11#*" p% 103(erkan V set'h:b9ect,)toolbar),X&i"ure)(J V is a hi"hly undesirable command and caused a lot o& troubles &or my per&ectly stable and runnin" GUI ?ish I hadn)t &ollowed this tutor)s advice

16-

on 2+ Sep 200+ at 2#27 p% 10$Price A Qery use&ul = almost too easy/

16<

on 0* Oct 200+ at 11#3* a% 10*6rhan !han+s &or this tutorial I would li+e to as+ a %uestion about colorbar I want to add a colorbar near my a#is component *ut I didn)t I& you help, I would be appreciated

16C

on 1$ Oct 200+ at 11#17 a% 10/A)it,a !han+s a lot !his helped me on somethin" I have tryin" to &i"ure out &or a lon" time

1-,

on 1+ Oct 200+ at 11#17 a% 107(harath 8i I)m tryin" to plot the movement o& my robot on my GUI but its not wor+in" what I)ve tried is usin" a while loop with plot'#,y( and hold on can you "ive me some tips the plottin" o& my code is here;
fun!tion sta t_ o'io_gui_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to sta t_ o'io_gui (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) set(handles&sta t_ o'io_gui#2Use Data2#1)/ "" Plotting to axis in GUI "sele!ts o'io_pos as the !u ent axes# so that "$atlab kno%s %he e to plot the data i - 1/ " Aoop fo getting and plotting data " disp(handles&sta t_ o'io_gui) %hile(handles&sta t_ o'io_gui -- 1) axes(handles& o'io_pos) handles&pos_(eas - o'io_ epo t(handles& o'io_add )/ " get(handles&pos_(eas#2Use Data2# o'io_ epo t(handles& o'io_add ) )/

" gets data f o( pos_(eas and plots data x - handles&pos_(eas(1)/ "! eates a 'e!to f o( ) to 1)# *) 1 2 + & & & 1), 0 - handles&pos_(eas(2)/ " e!o ding position data handles& e!o d_pos(i#.)- *x 0 pos_(eas(+),/ disp(handles& e!o d_pos) "plots the x and 0 data plot(handles& e!o d_pos(.#1)#handles& e!o d_pos(.#2))/ hold on "adds a title# x1axis des! iption# and 01axis des! iption title(2Go'io Position2)/ xlabel(23 data2)/ 0label(24 data2)/

" to !he!k fo d a%no% end

update in flag 'alue

guidata(h5b6e!t#handles)

1-1

on 20 Oct 200+ at /#3+ a% 10"louk :hh men !his all, are very use&ull tutorials I) m havin" a %uestion too I try to put the data &rom a pcolor comand to a#es in a "ui i built, &or my &inal pro9ect, &or e#ample when i clic+ on a push button 8ow i D m "oin" to import the pcolor comand into a push button @ !han+s in advance &or any help you can "ive me .ou+

1-2

on 2$ Oct 200+ at *#02 a% 10+-usta1a 8i, &irst than+ you &or this "olden tutorialA I have an a#es to plot a "raphic but without code only with mouse movement on a#es area in GUI My aim is calculatin" the &ourier coe&&icients belon"in" to "ra&ic which is plotted by user 5lease help me !han+s &or everyoneA

1-3 8ello,

on 12 4o' 200+ at 2#$7 a% 110Pi,ush

I am very new to Matlab and I &ound this tutorial to develop GUIs and I thin+ it is very very help&ul !hou"h all the other e#amples have wor+ed &or me but this plot e#ample does not &unction properly I have included everythin" as per the directions "iven in this tutorial but I error pushin" any o& the push buttons !he error is

a#es2 m and a#es2 &i" are my &ile names '4o not con&use( [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[= @@@ 6ttempt to re&erence &ield o& non=structure array >rror in FF_ a#es2_plot6#es1HpushbuttonH2allbac+ at <3 a#es'handles a#es1( >rror in FF_ "uiHmain&cn at C6 &eval'varar"inY;Z(J >rror in FF_ a#es2 at 42 "uiHmain&cn'"uiH7tate, varar"inY;Z(J >rror in FF_ I'h:b9ect,eventdata(a#es2')plot6#es1HpushbuttonH2allbac+),h:b9ect,eventdat a,"uidata'h:b9ect(( @@@ >rror while evaluatin" uicontrol 2allbac+ [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[a I have tried other e#amples also but I usually "et this error ?hen I run the GUI throu"h "uide then it wor+s properly but when I run it directly, the above error occurs I have chec+ed the tutorial 1, times and I dont thin+ I have mande any mista+es 5lease help me 8ere is the a#es m &ile code ?aitin" &or early reply
fun!tion 'a a gout - axes2('a a gin) " A3@B2 $1file fo axes2&fig " A3@B2# b0 itself# ! eates a ne% A3@B2 o aises the existing " singletonR& " " J - A3@B2 etu ns the handle to a ne% A3@B2 o the handle to " the existing singletonR& " " A3@B2(2CAAABACE2#h5b6e!t#e'entData#handles#&&&) !alls the lo!al " fun!tion na(ed CAAABACE in A3@B2&$ %ith the gi'en input a gu(ents& " " A3@B2(2P ope t02#2Oalue2#&&&) ! eates a ne% A3@B2 o aises the " existing singletonR& Bta ting f o( the left# p ope t0 'alue pai s a e " applied to the GUI befo e axes2_5peningD!n gets !alled& An " un e!ogni>ed p ope t0 na(e o in'alid 'alue (akes p ope t0 appli!ation " stop& All inputs a e passed to axes2_5peningD!n 'ia 'a a gin&

" " RBee GUI 5ptions on GUID@2s Iools (enu& allo%s onl0 one " instan!e to un (singleton)Q& " " Bee also. GUID@# GUIDAIA# GUIJAFDA@B " @dit the abo'e text to (odif0 the

Choose QGUI

esponse to help axes2

" Aast $odified b0 GUID@ '2&8 121Fo'12))< 1).+8.)1 " Begin initiali>ation !ode 1 D5 F5I @DII gui_Bingleton - 1/ gui_Btate - st u!t(2gui_Fa(e2# (filena(e# &&& 2gui_Bingleton2# gui_Bingleton# &&& 2gui_5peningD!n2# Maxes2_5peningD!n# &&& 2gui_5utputD!n2# Maxes2_5utputD!n# &&& 2gui_Aa0outD!n2# *, # &&& 2gui_Callba!k2# *,)/ if na gin Ha(p/Ha(p/ is!ha ('a a ginK1L) gui_Btate&gui_Callba!k - st 2fun!('a a ginK1L)/ end if na gout *'a a goutK1.na goutL, - gui_(ainf!n(gui_Btate# 'a a ginK.L)/ else gui_(ainf!n(gui_Btate# 'a a ginK.L)/ end " @nd initiali>ation !ode 1 D5 F5I @DII " 111 @xe!utes 6ust befo e axes2 is (ade 'isible& fun!tion axes2_5peningD!n(h5b6e!t# e'entdata# handles# 'a a gin) " Ihis fun!tion has no output a gs# see 5utputD!n& " h5b6e!t handle to figu e " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " 'a a gin !o((and line a gu(ents to axes2 (see OAGAGGIF) " Choose default !o((and line output fo handles&output - h5b6e!t/ set(h5b6e!t#2toolba 2#2figu e2)/ " Update handles st u!tu e guidata(h5b6e!t# handles)/ " UICAII (akes axes2 %ait fo " ui%ait(handles&figu e1)/ use axes2

esponse (see UIG@BU$@)

" 111 5utputs f o( this fun!tion a e etu ned to the !o((and line& fun!tion 'a a gout - axes2_5utputD!n(h5b6e!t# e'entdata# handles) " 'a a gout !ell a a0 fo etu ning output a gs (see OAGAGG5UI)/ " h5b6e!t handle to figu e " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA)

" Get default !o((and line output f o( handles st u!tu e 'a a goutK1L - handles&output/ " 111 @xe!utes on button p ess in plotAxes1_pushbutton& fun!tion plotAxes1_pushbutton_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to plotAxes1_pushbutton (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) "sele!ts axes1 as the !u ent axes# so that "$atlab kno%s %he e to plot the data axes(handles&axes1) "! eates a 'e!to x - ).1)/ "! eates a 'e!to 0 - ).1)/ f o( ) to 1)# *) 1 2 + & & & 1), f o( ) to 1)# *) 1 2 + & & & 1),

"plots the x and 0 data plot(x#0)/ "adds a title# x1axis des! iption# and 01axis des! iption title(2Axes 12)/ xlabel(23 data2)/ 0label(24 data2)/ guidata(h5b6e!t# handles)/ "updates the handles " 111 @xe!utes on button p ess in plotAxes2_pushbutton& fun!tion plotAxes2_pushbutton_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to plotAxes2_pushbutton (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) "sele!ts axes2 as the !u ent axes# so that "$atlab kno%s %he e to plot the data axes(handles&axes2) "! eates a 'e!to x - ).1)/ "! eates a 'e!to 0 - x&=2 f o( ) to 1)# *) 1 2 + & & & 1), *) 1 7 < & & & 1)),

"plots the x and 0 data plot(x#0)/ "adds a title# x1axis des! iption# and 01axis des! iption title(2Axes 22)/ xlabel(23 data2)/ 0label(24 data2)/ guidata(h5b6e!t# handles)/ "updates the handles " 111 @xe!utes on button p ess in !lea Axes_pushbutton& fun!tion !lea Axes_pushbutton_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to !lea Axes_pushbutton (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB

" handles st u!tu e %ith handles and use data (see GUIDAIA) "these t%o lines of !ode !lea s both axes !la(handles&axes1#2 eset2) !la(handles&axes2#2 eset2) guidata(h5b6e!t# handles)/ "updates the handles 1-4 on 12 4o' 200+ at +#*$ p% 111saran,a

I)m new to matlab GUI I &ound ur tutorial very use&ul to start with !han+s My re%uirement is to load a si"nal which I have ac%uired &rom an 642, I stored it in mat &ormat now I have need to browse &or this mat &ile and display it in my GUI can u help me on this 1-5 on 1$ 4o' 200+ at *#*" a% 112ApophiB 8i there, my name is Tan, and i am new to matlab last wee+ i started with the add="ui tutorial, pimped it a little bit the last &ew days, and now i "ot a little calculaterMJ( now i "ot a new challen"e i want to plot &unctions, wich i can put into a te#t&ield also i want to "et the roots o& this &unction 'i e #M3=4N# <( the problem is, i can print the &unction with e$plot 'plot would be better(, but i cant solve the &unction may someone can help me with this th# to everyone this site is awesome/
fun!tion 'a a gout - axesplotte ('a a gin) " A3@BPA5II@G $1file fo axesplotte &fig " A3@BPA5II@G# b0 itself# ! eates a ne% A3@BPA5II@G o aises the existing " singletonR& " " J - A3@BPA5II@G etu ns the handle to a ne% A3@BPA5II@G o the handle to " the existing singletonR& " " A3@BPA5II@G(2CAAABACE2#h5b6e!t#e'entData#handles#&&&) !alls the lo!al " fun!tion na(ed CAAABACE in A3@BPA5II@G&$ %ith the gi'en input a gu(ents& " " A3@BPA5II@G(2P ope t02#2Oalue2#&&&) ! eates a ne% A3@BPA5II@G o aises the " existing singletonR& Bta ting f o( the left# p ope t0 'alue pai s a e " applied to the GUI befo e axesplotte _5peningD!n gets !alled& An

" un e!ogni>ed p ope t0 na(e o in'alid 'alue (akes p ope t0 appli!ation " stop& All inputs a e passed to axesplotte _5peningD!n 'ia 'a a gin& " " RBee GUI 5ptions on GUID@2s Iools (enu& Choose QGUI allo%s onl0 one " instan!e to un (singleton)Q& " " Bee also. GUID@# GUIDAIA# GUIJAFDA@B " @dit the abo'e text to (odif0 the esponse to help axesplotte

" Aast $odified b0 GUID@ '2&8 1)1Fo'12))< 2+.72.)) " Begin initiali>ation !ode 1 D5 F5I @DII gui_Bingleton - 1/ gui_Btate - st u!t(2gui_Fa(e2# (filena(e# &&& 2gui_Bingleton2# gui_Bingleton# &&& 2gui_5peningD!n2# Maxesplotte _5peningD!n# &&& 2gui_5utputD!n2# Maxesplotte _5utputD!n# &&& 2gui_Aa0outD!n2# *, # &&& 2gui_Callba!k2# *,)/ if na gin Ha(p/Ha(p/ is!ha ('a a ginK1L) gui_Btate&gui_Callba!k - st 2fun!('a a ginK1L)/ end if na gout *'a a goutK1.na goutL, - gui_(ainf!n(gui_Btate# 'a a ginK.L)/ else gui_(ainf!n(gui_Btate# 'a a ginK.L)/ end " @nd initiali>ation !ode 1 D5 F5I @DII " 111 @xe!utes 6ust befo e axesplotte is (ade 'isible& fun!tion axesplotte _5peningD!n(h5b6e!t# e'entdata# handles# 'a a gin) " Ihis fun!tion has no output a gs# see 5utputD!n& " h5b6e!t handle to figu e " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " 'a a gin !o((and line a gu(ents to axesplotte (see OAGAGGIF) " Choose default !o((and line output fo handles&output - h5b6e!t/ set(h5b6e!t#2toolba 2#2figu e2)/ " Update handles st u!tu e guidata(h5b6e!t# handles)/ " UICAII (akes axesplotte %ait fo " ui%ait(handles&figu e1)/ use esponse (see UIG@BU$@) axesplotte

" 111 5utputs f o( this fun!tion a e etu ned to the !o((and line& fun!tion 'a a gout - axesplotte _5utputD!n(h5b6e!t# e'entdata# handles) " 'a a gout !ell a a0 fo etu ning output a gs (see OAGAGG5UI)/ " h5b6e!t handle to figu e " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " Get default !o((and line output f o( handles st u!tu e 'a a goutK1L - handles&output/ " 111 @xe!utes on button p ess in plot1_pushbutton1& fun!tion plot1_pushbutton1_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to plot1_pushbutton1 (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) "sele!ts axes1 as the !u ent axes# so that "$atlab kno%s %he e to plot the data axes(handles&axes1) !la/ " !lea axes

" get fun!tion f - get(handles&ente _te (#2Bt ing2)/ " p int fun!tion %ith e>plot e>plot(f) " $4 PG5BA@$. sol'e the fun!tion to get the to " st ing to fun!tion. is this ne!essa 0N k-st 2fun!(f) "sol'e the fun!tion&&& doesnt %o k > - fsol'e(k#x)) " nu(be to st ing# to displa0 the oot-nu(2st (>) " displa0 oots of the fun!tion set(handles& oot_text#2Bt ing2# oot)/ guidata(h5b6e!t# handles)/ "updates the handles oots# dont kno% ho%

g id

" 111 @xe!utes on button p ess in !lea Axes_pushbutton&

fun!tion !lea Axes_pushbutton_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to !lea Axes_pushbutton (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) "these t%o lines of !ode !lea s both axes !la(handles&axes1#2 eset2) !lea f/ set(handles&ente _te (#2Bt ing2#22)/ set(handles& oot_text#2Bt ing2#22)/ guidata(h5b6e!t# handles)/ "updates the handles

fun!tion ente _te (_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to ente _te ( (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " Jints. text " ente _te " get(h5b6e!t#2Bt ing2) etu ns !ontents of ente _te ( as etu ns !ontents of

st 2double(get(h5b6e!t#2Bt ing2)) ( as a double

"!he!ks to see if input is e(pt0& if so# default input1_editIext to >e o guidata(h5b6e!t# handles)/ " 111 @xe!utes du ing ob6e!t ! eation# afte setting all p ope ties& fun!tion ente _te (_C eateD!n(h5b6e!t# e'entdata# handles) " h5b6e!t handle to ente _te ( (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles e(pt0 1 handles not ! eated until afte all C eateD!ns !alled " Jint. edit !ont ols usuall0 ha'e a %hite ba!kg ound on Cindo%s& " Bee IBPC and C5$PUI@G& if isp! Ha(p/Ha(p/ isePual(get(h5b6e!t#2Ba!kg oundColo 2)# get()#2defaultUi!ont olBa!kg oundColo 2)) set(h5b6e!t#2Ba!kg oundColo 2#2%hite2)/ end 1-6 on 07 0ec 200+ at 11#$* p% 113a.a

can you tech me how to load data &rom matlab to GUI@my &ile in wav 1-on 0" 0ec 200+ at 12#$2 a% 11$a.a actually, now i do it &or "ui with the title analy$e the system underwater sounds i want to upload &ile &rom matlab' spectrum "raph( to "ui can u teach me how to do it@

1-<

on 2" 0ec 200+ at 12#20 a% 11*?iC !un !han+ you so much 1our tutorials help me "et into the GUI %uic+ly

1-C

on 1+ !an 2010 at *#3/ a% 11/kanok3at 1;)& fun!tion 'a a gout - de(o1('a a gin) 1;1& " D@$51 $1file fo de(o1&fig 1;2& " D@$51# b0 itself# ! eates a ne% D@$51 o aises the existing 1;+& " singletonR& 1;7& " 1;8& " J - D@$51 etu ns the handle to a ne% D@$51 o the handle to 1;9& " the existing singletonR& 1;:& " 1;;& " D@$51(2CAAABACE2#h5b6e!t#e'entData#handles#&&&) !alls the lo!al 1;<& " fun!tion na(ed CAAABACE in D@$51&$ %ith the gi'en input a gu(ents& 1<)& " 1<1& " D@$51(2P ope t02#2Oalue2#&&&) ! eates a ne% D@$51 o aises the 1<2& " existing singletonR& Bta ting f o( the left# p ope t0 'alue pai s a e 1<+& " applied to the GUI befo e de(o1_5peningD!n gets !alled& An 1<7& " un e!ogni>ed p ope t0 na(e o in'alid 'alue (akes p ope t0 appli!ation 1<8& " stop& All inputs a e passed to de(o1_5peningD!n 'ia 'a a gin& 1<9& " 1<:& " RBee GUI 5ptions on GUID@2s Iools (enu& Choose QGUI allo%s onl0 one 1<;& " instan!e to un (singleton)Q& 1<<& " 2))& " Bee also. GUID@# GUIDAIA# GUIJAFDA@B 2)1& 2)2& " @dit the abo'e text to (odif0 the esponse to help de(o1 2)+& 2)7& " Aast $odified b0 GUID@ '2&8 1<1Xan12)1) 11.11.7: 2)8& 2)9& " Begin initiali>ation !ode 1 D5 F5I @DII 2):& gui_Bingleton - 1/ 2);& gui_Btate - st u!t(2gui_Fa(e2# (filena(e# &&& 2)<& 2gui_Bingleton2# gui_Bingleton# &&& 21)& 2gui_5peningD!n2# Mde(o1_5peningD!n# &&& 211& 2gui_5utputD!n2# Mde(o1_5utputD!n# &&& 212& 2gui_Aa0outD!n2# *, # &&& 21+& 2gui_Callba!k2# *,)/ 217& if na gin Ha(p/Ha(p/ is!ha ('a a ginK1L) 218& gui_Btate&gui_Callba!k - st 2fun!('a a ginK1L)/ 219& end 21:& 21;& if na gout 21<& *'a a goutK1.na goutL, - gui_(ainf!n(gui_Btate# 'a a ginK.L)/ 22)& else 221& gui_(ainf!n(gui_Btate# 'a a ginK.L)/ 222& end 22+& " @nd initiali>ation !ode 1 D5 F5I @DII

227& 228& 229& " 111 @xe!utes 6ust befo e de(o1 is (ade 'isible& 22:& fun!tion de(o1_5peningD!n(h5b6e!t# e'entdata# handles# 'a a gin) 22;& " Ihis fun!tion has no output a gs# see 5utputD!n& 22<& " h5b6e!t handle to figu e 2+)& " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB 2+1& " handles st u!tu e %ith handles and use data (see GUIDAIA) 2+2& " 'a a gin !o((and line a gu(ents to de(o1 (see OAGAGGIF) 2++& 2+7& " Choose default !o((and line output fo de(o1 2+8& handles&output - h5b6e!t/ 2+9& set(h5b6e!t#2toolba 2#2figu e2)/ 2+:& " Update handles st u!tu e 2+;& guidata(h5b6e!t# handles)/ 2+<& 27)& " UICAII (akes de(o1 %ait fo use esponse (see UIG@BU$@) 271& " ui%ait(handles&figu e1)/ 272& 27+& 277& " 111 5utputs f o( this fun!tion a e etu ned to the !o((and line& 278& fun!tion 'a a gout - de(o1_5utputD!n(h5b6e!t# e'entdata# handles) 279& " 'a a gout !ell a a0 fo etu ning output a gs (see OAGAGG5UI)/ 27:& " h5b6e!t handle to 27;& " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB 27<& " handles st u!tu e %ith handles and use data (see GUIDAIA) 28)& 281& " Get default !o((and line output f o( handles st u!tu e 282& 'a a goutK1L - handles&output/ 28+& 287& 288& " 111 @xe!utes on button p ess in pushbutton1& 289& fun!tion pushbutton1_Callba!k(h5b6e!t# e'entdata# handles) 28:& " h5b6e!t handle to pushbutton1 (see GCB5) 28;& " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB 28<& " handles st u!tu e %ith handles and use data (see GUIDAIA) 29)& "axes(handles&axes1) 291& t-).)&))1.)&1 292& a-get(handles&edit1#2Bt ing2) 29+& x-st 2nu((a) 297& 298& plot(handles&axes1#t#x) 299& 29:& guidata(h5b6e!t#handles)/ 29;& 29<& 2:)& 2:1& 2:2& fun!tion edit1_Callba!k(h5b6e!t# e'entdata# handles) 2:+& " h5b6e!t handle to edit1 (see GCB5) 2:7& " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB 2:8& " handles st u!tu e %ith handles and use data (see GUIDAIA) 2:9&

2::& " Jints. get(h5b6e!t#2Bt ing2) etu ns !ontents of edit1 as text 2:;& " st 2double(get(h5b6e!t#2Bt ing2)) etu ns !ontents of edit1 as a double 2:<& 2;)& " 111 @xe!utes du ing ob6e!t ! eation# afte setting all p ope ties& 2;1& fun!tion edit1_C eateD!n(h5b6e!t# e'entdata# handles) 2;2& " h5b6e!t handle to edit1 (see GCB5) 2;+& " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB 2;7& " handles e(pt0 1 handles not ! eated until afte all C eateD!ns !alled 2;8& 2;9& " Jint. edit !ont ols usuall0 ha'e a %hite ba!kg ound on Cindo%s& 2;:& " Bee IBPC and C5$PUI@G& 2;;& if isp! Ha(p/Ha(p/ isePual(get(h5b6e!t#2Ba!kg oundColo 2)# get()#2defaultUi!ont olBa!kg oundColo 2)) 2;<& set(h5b6e!t#2Ba!kg oundColo 2#2%hite2)/ end

I& my input F sin'2NpiN5oNt( pro"ram can,t read t tFtime what should i do 2C, 8ey, i have a pro"ram in "ui which plots the radiation o& a year'&or each day startin" &rom 9une 2,,6 &inishin" may 2,,-( I did this pro"ram in "ui in which you can select year month and day and it plots the radiation durin" the day i was wonderin" i& you could tell me how would i add hold on in my "ui pro"ram so that i could see more than one plot 'so that i can correlate more than one days( in the same "raph 'maybe speci&ic days or a whole wee+ month or even the whole year in the same "raph( than+ you
fun!tion 'a a gout - gui('a a gin) " GUI $1file fo gui&fig " GUI# b0 itself# ! eates a ne% GUI o aises the existing " singletonR& " " J - GUI etu ns the handle to a ne% GUI o the handle to " the existing singletonR& " " GUI(2CAAABACE2#h5b6e!t#e'entData#handles#&&&) !alls the lo!al

on 0$ eb 2010 at *#23 a% 1174ikos

" fun!tion na(ed CAAABACE in GUI&$ %ith the gi'en input a gu(ents& " " GUI(2P ope t02#2Oalue2#&&&) ! eates a ne% GUI o aises the " existing singletonR& Bta ting f o( the left# p ope t0 'alue pai s a e " applied to the GUI befo e gui_5peningDun!tion gets !alled& An " un e!ogni>ed p ope t0 na(e o in'alid 'alue (akes p ope t0 appli!ation " stop& All inputs a e passed to gui_5peningD!n 'ia 'a a gin& " " RBee GUI 5ptions on GUID@2s Iools (enu& Choose QGUI allo%s onl0 one " instan!e to un (singleton)Q& " " Bee also. GUID@# GUIDAIA# GUIJAFDA@B " Cop0 ight 2))212))+ Ihe $athCo ks# In!& " @dit the abo'e text to (odif0 the esponse to help gui

" Aast $odified b0 GUID@ '2&8 121Xan12)1) 12.)8.79 " Begin initiali>ation !ode 1 D5 F5I @DII gui_Bingleton - 1/ gui_Btate - st u!t(2gui_Fa(e2# (filena(e# &&& 2gui_Bingleton2# gui_Bingleton# &&& 2gui_5peningD!n2# Mgui_5peningD!n# &&& 2gui_5utputD!n2# Mgui_5utputD!n# &&& 2gui_Aa0outD!n2# *, # &&& 2gui_Callba!k2# *,)/ if na gin Ha(p/Ha(p/ is!ha ('a a ginK1L) gui_Btate&gui_Callba!k - st 2fun!('a a ginK1L)/ end if na gout *'a a goutK1.na goutL, - gui_(ainf!n(gui_Btate# 'a a ginK.L)/ else gui_(ainf!n(gui_Btate# 'a a ginK.L)/ end " @nd initiali>ation !ode 1 D5 F5I @DII " 111 @xe!utes 6ust befo e gui is (ade 'isible& fun!tion gui_5peningD!n(h5b6e!t# e'entdata# handles# 'a a gin) " Ihis fun!tion has no output a gs# see 5utputD!n& " h5b6e!t handle to figu e " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " 'a a gin !o((and line a gu(ents to gui (see OAGAGGIF) " Choose default !o((and line output fo handles&output - h5b6e!t/ " Update handles st u!tu e guidata(h5b6e!t# handles)/ gui

" UICAII (akes gui %ait fo " ui%ait(handles&figu e1)/

use

esponse (see UIG@BU$@)

" 111 5utputs f o( this fun!tion a e etu ned to the !o((and line& fun!tion 'a a gout - gui_5utputD!n(h5b6e!t# e'entdata# handles) " 'a a gout !ell a a0 fo etu ning output a gs (see OAGAGG5UI)/ " h5b6e!t handle to figu e " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " Get default !o((and line output f o( handles st u!tu e 'a a goutK1L - handles&output/ " 111 @xe!utes on button p ess in pushbutton1& fun!tion pushbutton1_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to pushbutton1 (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA)

ead_0ea - get(handles&0ea # 2Oalue2)/ s%it!h ead_0ea !ase 1 x1-9/ !ase 2 x1-:/

end

ead_(onth - get(handles&(onth# 2Oalue2)/ s%it!h ead_(onth !ase 1 x2- 1/ !ase 2 x2-2/ !ase + x2-+/ !ase 7 x2-7/ !ase 8 x2-8/ !ase 9 x2-9/ !ase : x2-:/ !ase ; x2-;/ !ase < x2-</ !ase 1) x2-1)/ !ase 11

x2-11/ !ase 12 x2-12/ end ead_da0 - get(handles&da0# 2Oalue2)/ s%it!h ead_da0 !ase 1 x+-1/ !ase 2 x+-2/ !ase + x+-+/ !ase 7 x+-7/ !ase 8 x+-8/ !ase 9 x+-9/ !ase : x+-:/ !ase ; x+-;/ !ase < x+-</ !ase 1) x+-1)/ !ase 11 x+-11/ !ase 12 x+-12/ !ase 1+ x+-1+/ !ase 17 x+-17/ !ase 18 x+-18/ !ase 19 x+-19/ !ase 1: x+-1:/ !ase 1; x+-1;/ !ase 1< x+-1</ !ase 2) x+-2)/ !ase 21 x+-21/ !ase 22 x+-22/ !ase 2+ x+-2+/ !ase 27 x+-27/ !ase 28

x+-28/ !ase 29 x+-29/ !ase 2: x+-2:/ !ase 2; x+-2;/ !ase 2< x+-2</ !ase +) x+-+)/ !ase +1 x+-+1/ end load(2oloh ona_dedo(ena_aktino'olias&(at2)/ A1-*>e os(<9#+1) >e os(<9#+1) >e os(<9#+1) >e os(<9#+1) >e os(<9#+1) Iounios_da0)1 Iounios_da0)2 Iounios_da0)+ Iounios_da0)7 Iounios_da0)8 Iounios_da0)9 Iounios_da0): Iounios_da0); Iounios_da0)< Iounios_da01) Iounios_da011 Iounios_da012 Iounios_da01+ Iounios_da017 Iounios_da018 Iounios_da019 Iounios_da01: Iounios_da01; Iounios_da01< Iounios_da02) Iounios_da021 Iounios_da022 Iounios_da02+ Iounios_da027 Iounios_da028 Iounios_da029 Iounios_da02: Iounios_da02; Iounios_da02< Iounios_da0+) >e os(<9#1) Ioulios_da0)1 Ioulios_da0)2 Ioulios_da0)+ Ioulios_da0)7 Ioulios_da0)8 Ioulios_da0)9 Ioulios_da0): Ioulios_da0); Ioulios_da0)< Ioulios_da01) Ioulios_da011 Ioulios_da012 Ioulios_da01+ Ioulios_da017 Ioulios_da018 Ioulios_da019 Ioulios_da01: Ioulios_da01; Ioulios_da01< Ioulios_da02) Ioulios_da021 Ioulios_da022 Ioulios_da02+ Ioulios_da027 Ioulios_da028 Ioulios_da029 Ioulios_da02: Ioulios_da02; Ioulios_da02< Ioulios_da0+) Ioulios_da0+1 A'goustos_da0)1 A'goustos_da0)2 A'goustos_da0)+ A'goustos_da0)7 A'goustos_da0)8 A'goustos_da0)9 A'goustos_da0): A'goustos_da0); A'goustos_da0)< A'goustos_da01) A'goustos_da011 A'goustos_da012 A'goustos_da01+ A'goustos_da017 A'goustos_da018 A'goustos_da019 A'goustos_da01: A'goustos_da01; A'goustos_da01< A'goustos_da02) A'goustos_da021 A'goustos_da022 A'goustos_da02+ A'goustos_da027 A'goustos_da028 A'goustos_da029 A'goustos_da02: A'goustos_da02; A'goustos_da02< A'goustos_da0+) A'goustos_da0+1 Be(pte' is_da0)1 Be(pte' is_da0)2 Be(pte' is_da0)+ Be(pte' is_da0)7 Be(pte' is_da0)8 Be(pte' is_da0)9 Be(pte' is_da0): Be(pte' is_da0); Be(pte' is_da0)< Be(pte' is_da01) Be(pte' is_da011 Be(pte' is_da012 Be(pte' is_da01+ Be(pte' is_da017 Be(pte' is_da018 Be(pte' is_da019 Be(pte' is_da01: Be(pte' is_da01; Be(pte' is_da01< Be(pte' is_da02) Be(pte' is_da021 Be(pte' is_da022 Be(pte' is_da02+ Be(pte' is_da027 Be(pte' is_da028 Be(pte' is_da029 Be(pte' is_da02: Be(pte' is_da02; Be(pte' is_da02< Be(pte' is_da0+) >e os(<9#1) 5kto' is_da0)1 5kto' is_da0)2 5kto' is_da0)+ 5kto' is_da0)7 5kto' is_da0)8 5kto' is_da0)9 5kto' is_da0): 5kto' is_da0); 5kto' is_da0)< 5kto' is_da01) 5kto' is_da011 5kto' is_da012 5kto' is_da01+ 5kto' is_da017 5kto' is_da018 5kto' is_da019 5kto' is_da01: 5kto' is_da01; 5kto' is_da01< 5kto' is_da02) 5kto' is_da021 5kto' is_da022 5kto' is_da02+ 5kto' is_da027 5kto' is_da028 5kto' is_da029 5kto' is_da02: 5kto' is_da02; 5kto' is_da02< 5kto' is_da0+) 5kto' is_da0+1 Fio' is_da0)1 Fio' is_da0)2 Fio' is_da0)+ Fio' is_da0)7 Fio' is_da0)8 Fio' is_da0)9

Fio' is_da0): Fio' is_da0); Fio' is_da0)< Fio' is_da01) Fio' is_da011 Fio' is_da012 Fio' is_da01+ Fio' is_da017 Fio' is_da018 Fio' is_da019 Fio' is_da01: Fio' is_da01; Fio' is_da01< Fio' is_da02) Fio' is_da021 Fio' is_da022 Fio' is_da02+ Fio' is_da027 Fio' is_da028 Fio' is_da029 Fio' is_da02: Fio' is_da02; Fio' is_da02< Fio' is_da0+) >e os(<9#1) Deke' is_da0)1 Deke' is_da0)2 Deke' is_da0)+ Deke' is_da0)7 Deke' is_da0)8 Deke' is_da0)9 Deke' is_da0): Deke' is_da0); Deke' is_da0)< Deke' is_da01) Deke' is_da011 Deke' is_da012 Deke' is_da01+ Deke' is_da017 Deke' is_da018 Deke' is_da019 Deke' is_da01: Deke' is_da01; Deke' is_da01< Deke' is_da02) Deke' is_da021 Deke' is_da022 Deke' is_da02+ Deke' is_da027 Deke' is_da028 Deke' is_da029 Deke' is_da02: Deke' is_da02; Deke' is_da02< Deke' is_da0+) Deke' is_da0+1,/ A2-*Gena is_da0)1 Gena is_da0)2 Gena is_da0)+ Gena is_da0)7 Gena is_da0)8 Gena is_da0)9 Gena is_da0): Gena is_da0); Gena is_da0)< Gena is_da01) Gena is_da011 Gena is_da012 Gena is_da01+ Gena is_da017 Gena is_da018 Gena is_da019 Gena is_da01: Gena is_da01; Gena is_da01< Gena is_da02) Gena is_da021 Gena is_da022 Gena is_da02+ Gena is_da027 Gena is_da028 Gena is_da029 Gena is_da02: Gena is_da02; Gena is_da02< Gena is_da0+) Gena is_da0+1 De' a is_da0)1 De' a is_da0)2 De' a is_da0)+ De' a is_da0)7 De' a is_da0)8 De' a is_da0)9 De' a is_da0): De' a is_da0); De' a is_da0)< De' a is_da01) De' a is_da011 De' a is_da012 De' a is_da01+ De' a is_da017 De' a is_da018 De' a is_da019 De' a is_da01: De' a is_da01; De' a is_da01< De' a is_da02) De' a is_da021 De' a is_da022 De' a is_da02+ De' a is_da027 De' a is_da028 De' a is_da029 De' a is_da02: De' a is_da02; >e os(<9#1) >e os(<9#1) >e os(<9#1) $a tis_da0)1 $a tis_da0)2 $a tis_da0)+ $a tis_da0)7 $a tis_da0)8 $a tis_da0)9 $a tis_da0): $a tis_da0); $a tis_da0)< $a tis_da01) $a tis_da011 $a tis_da012 $a tis_da01+ $a tis_da017 $a tis_da018 $a tis_da019 $a tis_da01: $a tis_da01; $a tis_da01< $a tis_da02) $a tis_da021 $a tis_da022 $a tis_da02+ $a tis_da027 $a tis_da028 $a tis_da029 $a tis_da02: $a tis_da02; $a tis_da02< $a tis_da0+) $a tis_da0+1 Ap ilis_da0)1 Ap ilis_da0)2 Ap ilis_da0)+ Ap ilis_da0)7 Ap ilis_da0)8 Ap ilis_da0)9 Ap ilis_da0): Ap ilis_da0); Ap ilis_da0)< Ap ilis_da01) Ap ilis_da011 Ap ilis_da012 Ap ilis_da01+ Ap ilis_da017 Ap ilis_da018 Ap ilis_da019 Ap ilis_da01: Ap ilis_da01; Ap ilis_da01< Ap ilis_da02) Ap ilis_da021 Ap ilis_da022 Ap ilis_da02+ Ap ilis_da027 Ap ilis_da028 Ap ilis_da029 Ap ilis_da02: Ap ilis_da02; Ap ilis_da02< Ap ilis_da0+) >e os(<9#1) $ais_da0)1 $ais_da0)2 $ais_da0)+ $ais_da0)7 $ais_da0)8 $ais_da0)9 $ais_da0): $ais_da0); $ais_da0)< $ais_da01) $ais_da011 $ais_da012 $ais_da01+ $ais_da017 $ais_da018 $ais_da019 $ais_da01: $ais_da01; $ais_da01< $ais_da02) $ais_da021 $ais_da022 $ais_da02+ $ais_da027 $ais_da028 $ais_da029 $ais_da02: $ais_da02; $ais_da02< $ais_da0+) $ais_da0+1 >e os(<9#+1) >e os(<9#+1) >e os(<9#+1) >e os(<9#+1) >e os(<9#+1) >e os(<9#+1) >e os(<9#+1),/ if x1--9 "4ea A-A1/ fo i-1.12 "$onth if x2--i A-A(.#1T+1R(i11).+1Ri)/ end end

else "4ea A-A2/ fo i-1.12 "$onth if x2--i A-A(.#1T+1R(i11).+1Ri)/ end end end A-A(.#x+)/ if A-->e os(<9#1) " set(h5b6e!t# 2Bt ing2# ))/ e o dlg(2Fo Data A'ailable Please I 0 Again .(2#2@ else axes(handles&axes1)/ plot(A)#g id/ xlabel(2Ii(e (t)2) # 0label(2Gadiation (CS(2)2) title(2Gadiation2)/ " axis(*28 9) 8)) 1))),) end

o 2)/

" 111 @xe!utes on sele!tion !hange in 0ea & fun!tion 0ea _Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to 0ea (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " Jints. !ontents - get(h5b6e!t#2Bt ing2) etu ns 0ea !ontents as !ell a a0 " !ontentsKget(h5b6e!t#2Oalue2)L etu ns sele!ted ite( f o( 0ea " 111 @xe!utes du ing ob6e!t ! eation# afte setting all p ope ties& fun!tion 0ea _C eateD!n(h5b6e!t# e'entdata# handles) " h5b6e!t handle to 0ea (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles e(pt0 1 handles not ! eated until afte all C eateD!ns !alled " Jint. popup(enu !ont ols usuall0 ha'e a %hite ba!kg ound on Cindo%s& " Bee IBPC and C5$PUI@G& if isp! set(h5b6e!t#2Ba!kg oundColo 2#2%hite2)/ else set(h5b6e!t#2Ba!kg oundColo 2#get()#2defaultUi!ont olBa!kg oundC olo 2))/ end set(h5b6e!t# 2Bt ing2# K22))92# 22)):2L)/

" 111 @xe!utes on sele!tion !hange in (onth& fun!tion (onth_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to (onth (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " Jints. !ontents - get(h5b6e!t#2Bt ing2) etu ns (onth !ontents as !ell a a0 " !ontentsKget(h5b6e!t#2Oalue2)L etu ns sele!ted ite( f o( (onth " (onth - st 2double(get(h5b6e!t# 2Bt ing2))/ " handles&(onth - (onth/ " guidata(h5b6e!t#handles) " 111 @xe!utes du ing ob6e!t ! eation# afte setting all p ope ties& fun!tion (onth_C eateD!n(h5b6e!t# e'entdata# handles) " h5b6e!t handle to (onth (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles e(pt0 1 handles not ! eated until afte all C eateD!ns !alled " Jint. popup(enu !ont ols usuall0 ha'e a %hite ba!kg ound on Cindo%s& " Bee IBPC and C5$PUI@G& if isp! set(h5b6e!t#2Ba!kg oundColo 2#2%hite2)/ else set(h5b6e!t#2Ba!kg oundColo 2#get()#2defaultUi!ont olBa!kg oundC olo 2))/ end set(h5b6e!t# 2Bt ing2# K2Xanua 02# 2Deb ua 02#2$a !h2# 2Ap il2#2$a02#2Xune2#2Xul02#2August2#2Bepte(be 2#25!tobe 2#2Fo'e (be 2#2De!e(be 2L)/ " 111 @xe!utes on sele!tion !hange in da0& fun!tion da0_Callba!k(h5b6e!t# e'entdata# handles) " h5b6e!t handle to da0 (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB " handles st u!tu e %ith handles and use data (see GUIDAIA) " Jints. !ontents - get(h5b6e!t#2Bt ing2) etu ns da0 !ontents as !ell a a0 " !ontentsKget(h5b6e!t#2Oalue2)L etu ns sele!ted ite( f o( da0 " da0 - st 2double(get(h5b6e!t# 2Bt ing2))/ " handles&da0- da0/ " guidata(h5b6e!t#handles) " 111 @xe!utes du ing ob6e!t ! eation# afte setting all p ope ties& fun!tion da0_C eateD!n(h5b6e!t# e'entdata# handles) " h5b6e!t handle to da0 (see GCB5) " e'entdata ese 'ed 1 to be defined in a futu e 'e sion of $AIAAB

" handles e(pt0 1 handles not ! eated until afte C eateD!ns !alled

all

" Jint. popup(enu !ont ols usuall0 ha'e a %hite ba!kg ound on Cindo%s& " Bee IBPC and C5$PUI@G& if isp! set(h5b6e!t#2Ba!kg oundColo 2#2%hite2)/ else set(h5b6e!t#2Ba!kg oundColo 2#get()#2defaultUi!ont olBa!kg oundC olo 2))/ end set(h5b6e!t# 2Bt ing2# K212# 222#2+2# 272#282# 292#2:2# 2;2#2<2# 21)2#2112# 2122#21+2# 2172#2182# 2192#21:2# 21;2#21<2# 22)2#2212# 2222#22+2# 2272#2282# 2292#22:2# 22;2#22<2# 2+)2#2+12L)/ 2C1 on 10 eb 2010 at 12#27 p% 11"Anon,%ous

Good tut 2C2 on 1" eb 2010 at 10#1$ a% 11+Ashleigh 8i/ 1our tutorials have been e#tremely help&ul to me as I start to learn matlab/ I have a speci&ic %uestion now thou"h I)m creatin" a GUI &or wor+ and it has a plot on it that calls &or inputs &rom the user to create it 7o basically, say I want to plot yFsN'#B$(, the user enters )sF) and D$F) then presses UplotV and the "raph would show # vs y I was wonderin" i& there is a way &or the "raph to replot itsel& a&ter the user ma+es any chan"es to the input data !hat way, i& a user chan"es their data but &or"ets to press plot, they don)t con&use themselves loo+in" at their old plot &or their current data 6ny help you have would be "reat/ !han+s, 6shlei"h 2C3 h 2C4 on 2* eb 2010 at *#1$ a% 121-ieko than+s &or sharin" us Matlab tutorials it really helps me alot/ but i do wanted to as+ a %uestion relatin" to this topic my "raph shows on the GUI when i am plottin" small numbersOvalues &or # and y a#is but there)s an error when i try to plot lar"e values &or e#ample '&or #( &rom 1>6 to 1,,>6 on 1" eb 2010 at *#$7 p% 120Anon,%ous

i hope u can help me with that that would be a really bi" help &or me and our "roup pro9ect tn# a lot/ 2C5 on 0* -ar 2010 at 3#37 a% 122 inglas 1our second a#es does not plot a %uadratic &unction as it should 'last picture( MM !han+s &or these "reat tutorials !he Matlab tutorial is very obscure 2C6 8i@ 2Con 0* -ar 2010 at $#$1 p% 12$Ale.an)ro 8ello !han+ you very much &or your tutorial, it was very help&ul since matlab help is so con&usin" about "ui I am wor+in" on my "raduation pro9ect related with ima"e processin" I made a m &ile to do some processin" on certain variable U#V 6&ter I run my m &ile, the variable U#V is le&t in the wor+space with the ima"e that I want to use &rom the "ui, however when I use the "ui it shows the &ollowin" error; __ prueba"uide @@@ Unde&ined &unction or variable D#) 'A( Is there any way that I can use to call wor+space variables &rom my "ui@ I use imshow &unction !han+s a lot &or your help 2C< on 0" -ar 2010 at 10#3+ a% 12*Christina !han+s so much/ I had an aw&ul day at the uni because o& all this stu&& that i was shown very %uic+ly without bein" able to +eep notes/ !han+s a"ain and +eep up the "ood wor+/ 2hristina 7 2CC on 1" -ar 2010 at 10#13 p% 12/ka'ita hi pl$ help me to calculate the distance btween 2 pea+s in ima"e 8ow to "o abt either usin" 2UGQ>0I! or 6RI7 3,, on 20 -ar 2010 at +#1+ p% 127shan%ukha on 0* -ar 2010 at $#3/ p% 123Ale.an)ro

sir than+ you &or "ivin" valuable tutoruial sir please tell how to load di&&erent into di&&erent a#es i tried,but ima"e is "ettin" on last created a#es how can solve this@ 3,1 on 20 -ar 2010 at +#$0 p% 12"shan%ukha sir than+ you &or "ivin" valuable matlab tutoruial sir please tell how to load di&&erent ima"es into di&&erent a#es i tried,but ima"e is "ettin" on last created a#es how can solve this in matlab@ 3,2 on 21 -ar 2010 at /#1$ p% 12+shan%ukha 8i/ 1our tutorials have been e#tremely help&ul to me as I start to learn matlab/ I have a speci&ic %uestion now thou"h how can load di&&erent ima"es in di&&erent a#es li+e this suppose 1st ima"e in 1st a#es,2nd ima"e in 2nd a#es please solve this problem 3,3 8i !his is an e#cellent tutorials I would also love to as+ a %uestion re"ardin" my school wor+ Its about matlab :op and matlab GUI4> I have written a class and i can create di&&erent instances I can also plot the di&&erent instances'ob9ects( on my GUI'matlab( a#es usin" di&&erent shapes 6lthou"ht the di&&erent instances o& my class can be seen in the a#es , they are not ob9ects o& the GUI4> !here4 when ever i clic+ on any instance in the a#es, nothin" happens but when i clic+ somewhere else in the a#es, i can "et the 2urrent5oint 4o u have any idea on how i can inte"rate my instances tobe matlab GUI4> ob9ects such as pushbutton sothat i shall be able to de&ine the buttondown &unc Ge"ards mtn 3,4 on 1+ Apr 2010 at 1#*2 p% 131Chris 8ey, i would 9ust want to say than+ you to Euan Euach &or the many "reat tutorials and than+ the people at blin+ da""er &or a "enerally awesome and in&ormative web site Mr Euach i& one wanted to ma+e a Gui that displayed real time data that is constantly chan"in", how would one "o about it@ I as+ because i need to read in a si"nal &rom a microprocessor and display said si"nal on a real time basis, usin" matlab !han+ you in advance &or your assistance on 13 Apr 2010 at 3#*" a% 130%athias

5 s i do apolo"i$e i& anyone has as+ed a similar %uestion in the comments section 3,5 on 2" Apr 2010 at 2#03 a% 132letissier"* 8i everyone, i need some help with matlab I &ollowed this tutorial and it was "reat/ !ho i)m not so e#pert with Matlab, i was able to create a GUI with plottin" windows !he point is; usin" the ; set'h:b9ect,)toolbar),X&i"ure)(J an error accourred ?hat i need to do is insertin" a toolbar &or each plot i have in the GUI 8ow can i do this@ 3,6 on 2" Apr 2010 at *#11 a% 133letissier"* edit; &i#ed my problem I 9ust put my Uset'h:b9ect,)toolbar),X&i"ure)(JV command in the wron" position, now it)s alri"ht/ 3,on 0$ -a, 2010 at 2#1* a% 13$-arina I need an help 2an I input the data in GUI with a &unction that ac%uires data by serial with a while'1( cycle@ 8ow can reload the data &or the "raph in continuum@ !han+ you

Potrebbero piacerti anche