stateVector.stateVector

Return a new, empty stateVector object


Syntax



Description

obj = stateVector

Returns a new, empty state vector object. The new stateVector has no variables associated with it.

obj = stateVector(label)
obj = stateVector(labels)

Also applies a label to the state vector object. If unset, the label is set to an empty string. If labels is a string array, returns an array of state vector objects and applies the corresponding label to each individual state vector.

obj = stateVector(size)
obj = stateVector(size, labels)

Initializes an array of state vector objects of the indicated size. Optionally also applies a label to each object in the array. If applying labels, the size of the “labels” array must match the requested size of the stateVector array.


Input Arguments

labels

string array | cellstring array | char row vector
Labels for the elements of a stateVector array. If the only input, the output array will have the same size as labels. If combined with the “size” input, must be the size of the requested array.

size

row vector, positive integers
Indicates the size of the requested array of stateVector objects. Must have at least 2 elements, and all elements must be non-negative integers.

Output Arguments

obj

scalar stateVector object | stateVector array
A new, empty stateVector object or array of stateVector objects.