Assignment
Assigns new values to the specified signal elements.
Description
Block Assignment assigns values of input signals to selected signal elements. The indices of the elements to be assigned values are set either by entering the indices in the block dialogue box, or by connecting an external index source or sources to the block. The signal on the block’s data port, U, 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 parameters Number of output dimensions the settings for the first and/or second index 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, set the parameters for the corresponding index to Index option to Index vector (port)
or Starting index (port)
.
For example, consider a two-dimensional signal with index mode from one. The settings of the unit parameters Assignment 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 Y[1:end,[1 3 5]]=U
.
When usage of the block Assignment in normal mode, 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 |
Index 1
#
Index option —
item indexing method
Assign all
| Index vector (dialog)
| Index vector (port)
| Starting index (dialog)
| Starting index (port)
Details
Determines, based on the dimensionality of the input signal, how the elements of the signal should be indexed. Select from the list:
-
Assign all
- no further setting is required. All items are selected. -
Index vector (dialog)
- enables the parameters Index. Enter a vector of element indices. Do not select this option if the input signal is of variable size. -
Index vector (port)
- no further adjustment is required. -
Starting index (dialog)
- includes parameters Index и Output size. Enter the starting index of the range of elements to select in the parameters Index and the number of elements to select in the parameters Output size. Do not select this option if the input signal is of variable size. -
Starting index (port)
- includes the parameters Output size. Enter the number of elements to be selected in the parameters Output size.
When selecting the options Index vector (port)
or Starting index (port)
the block has a corresponding port and for the parameters Initialize output (Y) you can specify one of these values:
-
Initialize using input port <Y0>
-
Specify size for each dimension in table
Otherwise, Y0 always initialises the output port Y.
Parameters Index и *Output size*if they are not used for the selected mode *Index option*are simply ignored.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
Index —
element index
Scalar / array of integers
Details
If parameters Index option is equal to Index vector (dialog)
, enter the index of each item of interest.
If the parameters Index option equals Starting index (dialog)
, enter the starting index of the range of items to be selected. The number of items from the starting point is determined by the size of this dimension in U.
Dependencies
To use this parameter, set the parameters to Index option value Index vector (dialog)
or Starting index (dialog)
.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
#
Output size —
block output width
Integer
Details
Sets the width of the block output signal.
Dependencies
To use this parameter, set parameter Initialize output (Y) value Specify size for each dimension in table
.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
Index 2
#
Index option —
item indexing method
Assign all
| Index vector (dialog)
| Index vector (port)
| Starting index (dialog)
| Starting index (port)
Details
Determines, based on the dimensionality of the input signal, how the elements of the signal should be indexed. Select from the list:
-
Assign all
- no further setting is required. All items are selected. -
Index vector (dialog)
- enables the parameters Index. Enter a vector of element indices. Do not select this option if the input signal is of variable size. -
Index vector (port)
- no further adjustment is required. -
Starting index (dialog)
- includes parameters Index и Output size. Enter the starting index of the range of elements to select in the parameters Index and the number of elements to select in the parameters Output size. Do not select this option if the input signal is of variable size. -
Starting index (port)
- includes the parameters Output size. Enter the number of elements to be selected in the parameters Output size.
When selecting the options Index vector (port)
or Starting index (port)
the block has a corresponding port and for the parameters Initialize output (Y) you can specify one of these values:
-
Initialize using input port <Y0>
-
Specify size for each dimension in table
Otherwise, Y0 always initialises the output port Y.
Parameters Index и *Output size*if they are not used for the selected mode *Index option*are simply ignored.
Dependencies
To use this parameter, set parameter Number of output dimensions value greater than 1
.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
Index —
element index
Scalar / array of integers
Details
If parameters Index option is equal to Index vector (dialog)
, enter the index of each item of interest.
If the parameters Index option equals Starting index (dialog)
, enter the starting index of the range of items to be selected. The number of items from the starting point is determined by the size of this dimension in U.
Dependencies
To use this parameter, set parameter Number of output dimensions a value greater than 1
, and set parameters Index option value Index vector (dialog)
or Starting index (dialog)
.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
#
Output size —
block output width
Integer
Details
Sets the width of the block output signal.
Dependencies
To use this parameter, set parameters 1
to a value greater than 1
and set parameters Number of output dimensions value greater than 1
, and set parameters Initialize output (Y) value Specify size for each dimension in table
.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |