I am having trouble with is line "P_dot_ij_om_+ii(i,1)=P_dot_ij(k,2);" basically I have declared matrix P_dot_ij_om_1=[] from 1 to i and in the next line.
I would like to input data e.g. P_dot_ij_om_+ii(i,1)=P_dot_ij(k,2); where ii is a number. what is the right expression.
rows=round(k/360);
i=1;
ii=1;
k=1;
while ii <= rows
Pdot_names(ii,1)=string("P_dot_ij_om_"+ string(ii));
disp(Pdot_names(ii))
execstr(Pdot_names(ii)+'=[]'); // declare indexed matrix
while i<361
P_dot_ij_om_+ii(i,1)=P_dot_ij(k,2);
// P_dot_ij_om_+ii(i,2)=P_dot_ij(k,3);
disp(k)
k=k+1;
i=i+1;
end
ii=ii+1;
end
The code below works, but in general it is not advised to create string variables. There are much faster and also easier to implement alternatives, see e.g. this thread: How can I create variables Ai in loop in scilab, where i=1..10
And also next time please post selfcontained code examples, because otherwise I can only guess what is
k
andP_dot_ij
.