Call Figure In App Designer
uifigure (App Designer)
Description
example
fig = uifigure
creates a UI figure window using default property values configured for building apps in App Designer and returns the figure object.
example
fig = uifigure(
specifies UI figure properties using one or more Name,Value
)Name,Value
pair arguments.
Examples
collapse all
Create Default UI Figure
Set and Access UI Figure Properties
Create a UI figure with a specific title.
fig = uifigure('Name','Plotted Results');
Get the UI figure Position
property value.
Code CloseRequestFcn to Confirm Closing UI Figure
Code the UI figure CloseRequestFcn
callback to open a modal Confirmation dialog box when the user tries to close the figure window.
Copy and paste this code into the MATLAB® Editor, and then run closeFig
.
function closeFig fig = uifigure('Position',[100 100 350 275],... 'CloseRequestFcn',@(fig, event) my_closereq(fig)); end function my_closereq(fig) selection = questdlg('Close the figure window?',... 'Confirmation',... 'Yes','No','Yes'); switch selection, case 'Yes', delete(fig) case 'No' return end end
Click the figure close button. The Confirmation dialog box opens.
Input Arguments
collapse all
Name-Value Pair Arguments
Specify optional comma-separated pairs of Name,Value
arguments. Name
is the argument name and Value
is the corresponding value. Name
must appear inside single quotes (' '
). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN
.
Example: 'Name','My App'
specifies that the UI figure title bar text is My App.
The properties listed here are a subset of the available properties. For the full list, see UI Figure (App Designer) Properties.
collapse all
'Name'
— Title of UI figure
''
(default) | character vector
Title of the UI figure, specified as a character vector.
Example: 'Trial'
'Position'
— Location and size of UI figure, excluding borders and title bar
[left bottom width height]
Location and size of the UI figure, excluding borders and title bar, specified as a four-element vector of the form [left bottom width height]
.
This table describes each element in the vector.
Element | Description |
---|---|
left | Distance from the left edge of the primary display to the inner left edge of the UI figure window. This value can be negative on systems that have more than one monitor. |
bottom | Distance from the bottom edge of the primary display to the inner bottom edge of the UI figure window. This value can be negative on systems that have more than one monitor. |
width | Distance between the right and left inner edges of the UI figure. |
height | Distance between the top and bottom inner edges of the UI figure. |
Limitations
-
Currently, you cannot pass a figure object created with the
uifigure
function to theprint
,rotate3d
,pan
, orzoom
functions. If you attempt to do so, MATLAB throws an error .
Introduced in R2016a
Was this topic helpful?
Call Figure In App Designer
Source: https://lost-contact.mit.edu/afs/inf.ed.ac.uk/group/teaching/matlab-help/R2016b/matlab/ref/uifigure.html
Posted by: hermanwerharters.blogspot.com
0 Response to "Call Figure In App Designer"
Post a Comment