Ticket #6099: Test.mo
| File Test.mo, 365 bytes (added by , 6 years ago) |
|---|
| Line | |
|---|---|
| 1 | package Test |
| 2 | |
| 3 | function f1 |
| 4 | input Real Z[:,:]; |
| 5 | output Real y; |
| 6 | algorithm |
| 7 | y:= 1/(sum({{ Z[i,j] for j in 1:size(Z,2)} for i in 1:size(Z,1)})); |
| 8 | end f1; |
| 9 | |
| 10 | model M1 |
| 11 | constant Integer n = 2; |
| 12 | constant Integer m = 1; |
| 13 | Real[n,m] Z(start=[1; 0]); |
| 14 | Real x; |
| 15 | equation |
| 16 | Z = {{ 0 for j in 1:m} for i in 1:n}; |
| 17 | x = f1(Z); |
| 18 | end M1; |
| 19 | |
| 20 | end Test; |
