MATLAB Function Reference (Volume 2: Graphics)
MATLAB Function Reference (Volume 2: Graphics) MATLAB Function Reference (Volume 2: Graphics)
uicontrolExamplesThe following statement creates a push button that clears the current axeswhen pressed:h = uicontrol('Style', 'pushbutton', 'String', 'Clear',...'Position', [20 150 100 70], 'Callback', 'cla');You can create a uicontrol object that changes figure colormaps by specifying apop-up menu and supplying an M-file name as the object’s Callback:hpop = uicontrol('Style', 'popup',...'String', 'hsv|hot|cool|gray',...'Position', [20 320 100 50],...'Callback', 'setmap');The above call to uicontrol defines four individual choices in the menu: hsv,hot, cool, and gray. You specify these choices with the String property,separating the choices with the “|” character.The Callback, in this case setmap, is the name of an M-file that defines a morecomplicated set of instructions than a single MATLAB command. setmapcontains these statements:val = get(hpop,'Value');if val == 1colormap(hsv)elseif val == 2colormap(hot)elseif val == 3colormap(cool)elseif val == 4colormap(gray)endThe Value property contains a number that indicates the selected choice. Thechoices are numbered sequentially from one to four. The setmap M-file can getand then test the contents of the Value property to determine what action totake.2-540
uicontrolObjectHierarchyRootFigureAxesUicontrolUimenuUicontextmenuUimenuUimenuSee Alsotextwrap, uimenu2-541
- Page 519 and 520: Surface Propertiesgetframe, or paus
- Page 521 and 522: Surface PropertiesMarkerSize size i
- Page 523 and 524: Surface PropertiesVertexNormals vec
- Page 525 and 526: surfllight source, use surfl(X',Y',
- Page 527 and 528: surfnormPurpose2surfnormCompute and
- Page 529 and 530: terminalPurpose2terminalSet graphic
- Page 531 and 532: texlabelPurpose2texlabelProduce TeX
- Page 533 and 534: textPurpose2textCreate text object
- Page 535 and 536: textannotate the point at (pi,0) wi
- Page 537 and 538: textProperty Name Property Descript
- Page 539 and 540: textProperty Name Property Descript
- Page 541 and 542: Text PropertiesCreateFcnstringCallb
- Page 543 and 544: Text PropertiesExtentposition recta
- Page 545 and 546: Text PropertiesWhen a handle is not
- Page 547 and 548: Text PropertiesPosition[x,y,[z]]Loc
- Page 549 and 550: Text PropertiesCharacterSequenceSym
- Page 551 and 552: Text PropertiesVerticalAlignment to
- Page 553 and 554: titlePurpose2titleAdd title to curr
- Page 555 and 556: trimeshPurpose2trimeshTriangular me
- Page 557 and 558: uicontextmenuPurpose2uicontextmenuC
- Page 559 and 560: uicontextmenuWhen the user extend-c
- Page 561 and 562: uicontextmenu Propertiesdefines a d
- Page 563 and 564: uicontextmenu Propertieswhere vecto
- Page 565 and 566: uicontrolString property (even thou
- Page 567 and 568: uicontrolProperty Name Property Des
- Page 569: uicontrolProperty Name Property Des
- Page 573 and 574: uicontrol Propertiesinterrupting ca
- Page 575 and 576: uicontrol Properties• on - The ui
- Page 577 and 578: uicontrol PropertiesFixedWidthFontN
- Page 579 and 580: uicontrol Propertiesdefined, that c
- Page 581 and 582: uicontrol Properties• Toggle butt
- Page 583 and 584: uicontrol PropertiesFor multiple li
- Page 585 and 586: uicontrol PropertiesSet the Value p
- Page 587 and 588: uigetfileSee Alsouiputfile2-557
- Page 589 and 590: uimenuYou can set and query propert
- Page 591 and 592: uimenuExamplesThis example creates
- Page 593 and 594: uimenu Propertiescallbacks; see the
- Page 595 and 596: uimenu PropertiesForegroundColor Co
- Page 597 and 598: uimenu Propertiescharacter while th
- Page 599 and 600: uiputfilePurpose2uiputfileInteracti
- Page 601 and 602: uiresume, uiwaitPurpose2uiresume, u
- Page 603 and 604: uisetfontPurpose2uisetfontModify fo
- Page 605 and 606: viewPurpose2viewViewpoint specifica
- Page 607 and 608: viewaxes graphics object properties
- Page 609 and 610: viewmtxT = viewmtx(az,el,phi,xc) re
- Page 611 and 612: viewmtxTransform the cube vectors t
- Page 613 and 614: waitforPurpose2waitforWait for cond
- Page 615 and 616: warndlgPurpose2warndlgDisplay warni
- Page 617 and 618: waterfallExamplesProduce a waterfal
- Page 619 and 620: xlabel, ylabel, zlabelPurpose2xlabe
uicontrolExamplesThe following statement creates a push button that clears the current axeswhen pressed:h = uicontrol('Style', 'pushbutton', 'String', 'Clear',...'Position', [20 150 100 70], 'Callback', 'cla');You can create a uicontrol object that changes figure colormaps by specifying apop-up menu and supplying an M-file name as the object’s Callback:hpop = uicontrol('Style', 'popup',...'String', 'hsv|hot|cool|gray',...'Position', [20 320 100 50],...'Callback', 'setmap');The above call to uicontrol defines four individual choices in the menu: hsv,hot, cool, and gray. You specify these choices with the String property,separating the choices with the “|” character.The Callback, in this case setmap, is the name of an M-file that defines a morecomplicated set of instructions than a single <strong>MATLAB</strong> command. setmapcontains these statements:val = get(hpop,'Value');if val == 1colormap(hsv)elseif val == 2colormap(hot)elseif val == 3colormap(cool)elseif val == 4colormap(gray)endThe Value property contains a number that indicates the selected choice. Thechoices are numbered sequentially from one to four. The setmap M-file can getand then test the contents of the Value property to determine what action totake.2-540