| Contents | Index |
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)
t_out = coder.resize(t, sz, variable_dims) returns a modified copy of coder.Type t with upper-bound size sz, and variable dimensions variable_dims. If variable_dims or sz are scalars, they are applied to all dimensions of t. By default, variable_dims does not apply to dimensions where sz is 0 or 1, which are always 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, in which case, coder.resize resizes all elements of the cell array.
t_out = coder.resize(t, sz) resizes t to have size sz.
t_out = coder.resize(t,[],variable_dims) changes t to have variable dimensions variable_dims while leaving the size unchanged.
t_out = coder.resize(t, sz, variable_dims, Name, Value) resizes t using additional options specified by one or more Name, Value pair arguments.
t_out = coder.resize(t, 'sizelimits', limits) resizes t with dimensions automatically 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.
Specify optional comma-separated pairs of Name,Value arguments, where 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.
t_out |
Resized coder.Type object |
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 a as 5x5Make 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
coder.newtype | coder.typeof | fiaccel

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |