modelVectorsMatrices2
Example 2 on vetors and matrices
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
Description
This is the second example of this package, providing different declarations of vectors and matrices.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real[2,2] | A | {{1, 2}, {3, 4}} | |
| Real[3,3] | B | {{cos((i - j)*2*Modelica.Constants.pi/3) for i in 0:2} for j in 0:2} | |
| Real[:,:] | C | {cos((i - j)*2*Modelica.Constants.pi/3) for i in 0:2, j in 0:2} | |
| Real[2,2] | D | zeros(2, 2) | |
| Real[:,:] | E | ones(2, 2) | |
| Real[2,2] | F | fill(4, 2, 2) | |
| Real[:,:] | G | diagonal({1, 2}) | |
| Real | S | sum(E) | |
| Real | Y | A[1, 1]*4 + A[2, 2] |