| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
get(h)
get(h,'PropertyName')
<m-by-n value cell array> =
get(H,pn)
a = get(h)
a = get(0)
a = get(0,'Factory')
a = get(0,'FactoryObjectTypePropertyName')
a = get(h,'Default')
a = get(h,'DefaultObjectTypePropertyName')
Note Do not use the get function on Java objects as it will cause a memory leak. For more information, see Accessing Private and Public Data |
get(h) returns all properties of the graphics object identified by the handle h and their current values. For this syntax, h must be a scalar.
get(h,'PropertyName') returns the value of the property 'PropertyName' of the graphics object identified by h.
<m-by-n value cell array> = get(H,pn) returns n property values for m graphics objects in the m-by-n cell array, where m = length(H) and n is equal to the number of property names contained in pn.
a = get(h) returns a structure whose field names are the object's property names and whose values are the current values of the corresponding properties. If you do not specify an output argument, MATLAB displays the information on the screen. For this syntax, h may be a scalar or a m-by-n array of handles. If h is a vector, a will be a (m*n)-by-1 struct array.
a = get(0) returns the current values of all user-settable properties. a is a structure array whose field names are the object property names and whose field values are the values of the corresponding properties. If you do not specify an output argument, MATLAB displays the information on the screen.
a = get(0,'Factory') returns the factory-defined values of all user-settable properties. a is a structure array whose field names are the object property names and whose field values are the values of the corresponding properties. If you do not specify an output argument, MATLAB displays the information on the screen.
a = get(0,'FactoryObjectTypePropertyName') returns the factory-defined value of the named property for the specified object type. The argument FactoryObjectTypePropertyName is the word Factory concatenated with the object type (e.g., Figure) and the property name (e.g., Color)FactoryFigureColor.
a = get(h,'Default') returns all default values currently defined on object h. a is a structure array whose field names are the object property names and whose field values are the values of the corresponding properties. If you do not specify an output argument, MATLAB displays the information on the screen.
a = get(h,'DefaultObjectTypePropertyName') returns the factory-defined value of the named property for the specified object type. The argument DefaultObjectTypePropertyName is the word Default concatenated with the object type (e.g., Figure) and the property name (e.g., Color).
DefaultFigureColor
You can obtain the default value of the LineWidth property for line graphics objects defined on the root level with the statement
get(0,'DefaultLineLineWidth') ans = 0.5000
To query a set of properties on all axes children, define a cell array of property names:
props = {'HandleVisibility', 'Interruptible';
'SelectionHighlight', 'Type'};
output = get(get(gca,'Children'),props);The variable output is a cell array of dimension length(get(gca,'Children')-by-4.
For example, type
patch;surface;text;line output = get(get(gca,'Children'),props) output = 'on' 'on' 'on' 'line' 'on' 'off' 'on' 'text' 'on' 'on' 'on' 'surface' 'on' 'on' 'on' 'patch'
Graphics Object Identification for related functions
![]() | genvarname | get (COM) | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |