Ticket #2292: Sample_Vs_vector.mo

File Sample_Vs_vector.mo, 378 bytes (added by Adeel Asghar, 11 years ago)
Line 
1model M
2 Real temper[10];
3 Integer k(start = 0);
4 Integer i;
5algorithm
6 when sample(0, 100) then
7 k:=1 + integer(time / 100);
8 end when;
9 when sample(0, 10) then
10 i:=1 + integer((time - (k - 1) * 100) / 10);
11 temper[i]:=17 + temper[i];
12 end when;
13 annotation(experiment(StartTime = 0.0, StopTime = 1000.0, Tolerance = 0.000001));
14end M;
15