gobjects - Initialize array for graphics objects - MATLAB (original) (raw)
Initialize array for graphics objects
Syntax
Description
[H](#btuqjyh-H) = gobjects([n](#btuqjyh-n))
returns an n
-by-n
graphics object array. Use the gobjects
function instead of the ones
or zeros
functions to preallocate an array to store graphics objects.
[H](#btuqjyh-H) = gobjects([s1,...,sn](#btuqjyh-s1sn))
returns an s1
-by-...-by-sn
graphics object array, where the list of integers s1,...,sn
defines the dimensions of the array. For example, gobjects(2,3)
returns a 2-by-3 array.
[H](#btuqjyh-H) = gobjects([v](#btuqjyh-v))
returns a graphics object array where the elements of the row vector, v
, define the dimensions of the array. For example, gobjects([2,3,4])
returns a 2-by-3-by-4 array.
[H](#btuqjyh-H) = gobjects
returns a 1-by-1 graphics object array.
[H](#btuqjyh-H) = gobjects([0](#btuqjyh-0))
returns an empty graphics object array.
Examples
Preallocate a 4-by-1 array to store graphics handles.
H = 4×1 GraphicsPlaceholder array:
GraphicsPlaceholder GraphicsPlaceholder GraphicsPlaceholder GraphicsPlaceholder
Create an array to store graphics handles using the size of an existing array.
Define A
as a 3-by-4 array.
A = [1,2,3,2; 4,5,6,6; 7,8,9,7];
Create an array of graphics handles using the size of A
.
v = size(A); H = gobjects(v);
The dimensions of the graphics handle array are the same as the dimensions of A
.
Use the gobjects
function to return an empty array.
H = 0×0 empty GraphicsPlaceholder array.
Input Arguments
Size of the object array, specified as an integer value. Negative integers are treated as 0. The array has dimensions n
-by-n
.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Size of each array dimension, specified as a list of two or more integer values. Negative integers are treated as 0.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Size of each array dimension, specified as a row vector of integer values. Negative integers are treated as 0.
Example: [2,4,6,7]
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Define an empty array by specifying one or more dimension equal to 0
Output Arguments
Initialized graphics object array of type GraphicsPlaceholder
. Use this array to contain any type of graphics object.
Version History
Introduced in R2013a