This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Iterated Assignment with the Assignment Block

This example shows using the Assignment block to assign values computed in a For or While Iterator loop to successive elements. You can use vector, matrix or multidemensional signals and do the assignment in a single time step. In this model, the For Iterator block creates a vector signal each of whose elements equals where is the index of the element.

The iterator generates indices for the Assignment block. On the first iteration, the Assignment block copies the first input (Y0) to the output (Y) and assigns the second input (U) to the output Y(E1). On successive iterations, the Assignment block assigns the current value of U to Y(Ei), that is, without first copying Y0 to Y. These actions occur in a single time step.