Assignment
Assigns new values to the specified signal elements.
blockType: Assignment
Path in the library:
|
Description
The Assignment block assigns input signal values to selected signal elements. The indexes of the elements to which the values are to be assigned are set either by entering the index parameters in the block parameters window or by connecting an external index source or sources to the block. The signal on the U port of the block specifies the values to be assigned to Y. The block replaces the specified Y0 elements with elements from the data signal.
Depending on the value you enter for the parameter Number of output dimensions, the parameter settings for the required number of indices are displayed. For each measurement, you can define the signal elements to work with. Specify a vector signal as one-dimensional and a matrix signal as two-dimensional. To enable the external index port, for the corresponding index, set the parameters Index option to Index vector (port)
or Starting index (port)
.
For example, consider a two-dimensional signal with index mode from one. The parameter settings for the Assignment unit will change to include one group of parameters for each measurement. If you define each dimension using the following entries:
-
for the first index: Index option value
Assign all
; -
For the second index:
-
Index option value
Index vector (dialog)
; -
Index value
[1 3 5]
.
-
Then the assigned values are of the form Y[1:end,[1 3 5]]=U
.
When usage of the Assignment block is normal, Engee initialises the block outputs with zero, even if they are not explicitly initialised in the model.
The block can be used to assign values to vector or matrix signals.
Ports
Output
#
Y
—
output signal with assigned values
vector
| matrix
Details
Output signal with assigned values for the specified elements.
Data types |
|
Complex numbers support |
Yes |
Input
#
Y0
—
initialisation input signal
vector
| matrix
Details
Initialisation signal for the output signal. If no other value is assigned to the element, the value of the output element is the same as the value of this input signal.
Data types |
|
Complex numbers support |
Yes |
#
U
—
input data port
scalar
| vector
| matrix
Details
The value assigned to the output element, if specified.
Data types |
|
Complex numbers support |
Yes |
#
Idx1N
—
Nth index signal
scalar
| vector
Details
An external port that specifies an index for assigning the corresponding output element.
Dependencies
To use this port, set parameters Index option value Index vector (port)
or Starting index (port)
.
Data types |
|
Complex numbers support |
Yes |
Parameters
Main
#
Number of output dimensions —
number of dimensions to be processed
Integer
Details
The number of processed dimensions ( ) specified by the user must match the actual number of input dimensions.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
#
Index mode —
Specify the initial indexing number
One-based
| Zero-based
Details
Specify the indexing mode as Zero-based
or One-based
.
For Zero-based
index 0
specifies the first element of the input vector. Index 1
defines the second element and so on.
For One-based
index 1
index specifies the first element of the input vector. Index 2
, specifies the second element and so on.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
Initialize output (Y) —
input signal acquisition method
Initialize using input port <Y0>
| Specify size for each dimension in table
Details
Specify how to initialise the output signal.
Initialize using input port <Y0>
- signal on input port Y0 initialises the output signal.
Specify size for each dimension in table
- it is required to specify the width of the block output signal in the parameters Output size. If the output has unassigned elements, the value of these elements is undefined.
Dependencies
To use this parameter, set parameter Index option value Index vector (port)
or Starting index (port)
for one or more measurements.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
Action if any output element is not assigned —
action if all output elements are not assigned
Error
| None
Details
Specify whether to generate an error if all output elements are not assigned. Options include:
-
None
- no action. -
Error
- Engee terminates the simulation and displays an error.
Dependencies
To use this parameter, set the parameters to Index option value Index vector (port)
or Starting index (port)
for one or more measurements, then set the parameters to Initialize output (Y) value Specify size for each dimension in table
.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |