setElement
Change element stored at specified index
Syntax
dataset = setElement(dataset,index,... element)
dataset = setElement(index,element, name)
Description
changes the element stored at the specified index, for an existing index. If
dataset
= setElement(dataset
,index
,... element
)index
is one greater than the number of elements in the data set, the
function adds the element at the end of the data set.
dataset = setElement(
changes the element stored at the specified index and gives it the name that you specify. You
can use index
,element
, name
)name
to identify an element that does not have a name. If the
signal already has a name, the element instead uses the name you specify by using the
name
argument.
Input Arguments
Output Arguments
Examples
Alternative
You can use curly braces to streamline indexing syntax to change an element in a dataset,
instead of using setElement
. The index must be a scalar that is not greater
than the number of elements in the variable. For example, change the name of second element of
the logsout
dataset.
logsout{2}.Name = 'secondSignal'
Version History
Introduced in R2011a