Dear All,
I am facing issues in expanding matrix elements depending on the values. The detailed logic is given as follows:
if UNIT(j) Number of Units
/ 1 1
2 3
3 2
4 0
5 1 /
and
CAP(j) Capacities of Units
/ 1 200
2 450
3 500
4 1000
5 700 /
Then the result in the VERTICAL(c) should be the corresponding capacity CAP with the repetition according to the value in UNIT
VERTICAL(c)
1 200
2 450
3 450
4 450
5 500
6 500
7 1000
Thanks
The code is given as follows:
Code: Select all
Sets j /1*5/
c /1*7/;
Parameters
UNIT(j) Number of Units
/ 1 1
2 3
3 2
4 0
5 1 /
CAP(j) Capacities of Units
/ 1 200
2 450
3 500
4 1000
5 700 /
VERTICAL(c);