struct
Creates one or more structs with the specified fields and value(s) .
Syntax
R = struct(x1,y1,x2,y2,.....)
Inputs
- x1
- Field name for the resultant struct.
- y1
- Value(s) of x1. If the value in not a single element, then it must be a cell containing the individual values. All value elements (y1, y2, ...) must have the same dimension.
Outputs
- R
- Resultant struct array.
Examples
R = struct('foo', 1)
R = struct [
foo: 1
]
R = struct('foo', {1,2,3}, 'bar', {'a','b','c'})
R = struct [
Struct array of size 1 x 3 with fields:
bar
foo
]