modelVectorsMatrices1
Example 1 on vetors and matrices
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
Description
This is the first example of this package, providing different declarations of vectors and matrices.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real[3] | a | {1, 2, 3} | |
| Real | b | 3:-1:1 | |
| Real[3] | c | zeros(3) | |
| Real[:] | d | ones(3) | |
| Real[3] | e | fill(4, 3) | |
| Real[:] | f | a.*e | |
| Real[:] | g | {a[i]*e[i] for i in 1:size(a, 1)} | |
| Real | h | a*e | |
| Real[:] | i | {(k - 1)/5 for k in 1:5} | |
| Real | s | sum(a) | |
| Real | p | product(a) | |
| Real | l | size(a, 1) | |
| Real | y | a[1]*3 + a[3] |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Real[3] | z |