Question: difficulty in filling an array table with vectors of different lengths


I am trying to create a do loop to generate y values from a series of vectors containing the x's. In the end, I will be exporting this data to Excel, so I want to put it into a Vector.

My problem is that sometimes I have 11 x's and sometimes I only have 9 x's.

observed := rtable(1 .. 2, 1 .. 3)
for k from 1 to 2 do 
for j from 1 to 3 do 
observed[k][j] := evalf(subs(HK[1] = C1[k, 1], S = C1[k, 2], FIO2 = X[k][j], eq1compartmentfinal)) 
end do 
end do;
Error, (in rtable/Sum) invalid arguments

where j vary's in length for my problem.  


If I remove the j loop, then I am able to get an output, put that would take a long time to get all of the data I need.

Please Wait...