Ticket #6099: Test.mo

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