Package: coder
Resize a coder.Type
object
t_out = coder.resize(t, sz, variable_dims)
t_out = coder.resize(t, sz)
t_out = coder.resize(t,[],variable_dims)
t_out = coder.resize(t, sz, variable_dims,
Name, Value)
t_out = coder.resize(t,
'sizelimits', limits)
returns
a modified copy of t_out
= coder.resize(t
, sz
, variable_dims
)coder.Type
t
with
upper-bound size sz
, and variable dimensions variable_dims
.
If variable_dims
or sz
are
scalars, the function applies them to all
dimensions of t
. By default, variable_dims
does
not apply to dimensions where sz
is 0
or 1
,
which are fixed. Use the 'uniform' option to override this special
case. coder.resize
ignores variable_dims
for
dimensions with size inf
. These dimensions are
always variable size. t
can
be a cell array of types, in which case, coder.resize
resizes
all elements of the cell array.
resizes t_out
= coder.resize(t
, sz
)t
to
have size sz
.
changes t_out
= coder.resize(t
,[],variable_dims
) t
to
have variable dimensions variable_dims
while leaving
the size unchanged.
resizes t_out
= coder.resize(t
, sz
, variable_dims
,
Name, Value)t
using additional
options specified by one or more Name, Value pair arguments.
resizes t_out
= coder.resize(t
,
'sizelimits', limits
)t
with
dimensions becoming variable based on the limits
vector.
When the size S
of a dimension is greater than
or equal to the first threshold defined in limits
,
the dimension becomes variable size with upper bound S
.
When the size S
of a dimension is greater than
or equal to the second threshold defined in limits
,
the dimension becomes unbounded variable size.
|
Two-element vector (or a scalar-expanded, one-element vector)
of variable-sizing thresholds. If the size |
|
New size for |
|
|
|
Specify whether each dimension of t_out is fixed or variable size. |
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
.
|
Setting Default: false |
|
Setting Default: false |
|
Resized |
Change a fixed-size array to a bounded, variable-size array.
t = coder.typeof(ones(3,3)) % t is 3x3 coder.resize(t, [4 5], 1) % returns :4 x :5 % ':' indicates variable-size dimensions
Change a fixed-size array to an unbounded, variable-size array.
t = coder.typeof(ones(3,3)) % t is 3x3 coder.resize(t, inf) % returns :inf x :inf % ':' indicates variable-size dimensions % 'inf' indicates unbounded dimensions
Resize a structure field.
ts = coder.typeof(struct('a', ones(3, 3))) % returns field a as 3x3 coder.resize(ts, [5, 5], 'recursive', 1) % returns field as 5x5
Resize a cell array.
tc = coder.typeof({1 2 3}) % returns 1x3 cell array coder.resize(tc, [5, 5], 'recursive', 1) % returns cell array as 5x5
Make a fixed-sized array variable size based on bounded and unbounded thresholds.
t = coder.typeof(ones(100,200)) % t is 100x200 coder.resize(t,'sizelimits', [99 199]) % returns :100x:inf % ':' indicates variable-size dimensions % :inf is unbounded variable size