Storing values from a loop into an array
Mostrar comentarios más antiguos
Coding:
for t = 1:24
OT(t,1) = (((Tmax + Tmin)/2)+((Tmax - Tmin)/2)*sin(((t - 9)/12)*PI));
ST(t,1) = OT(t)-5;
B(5,1) = (-1)*Ae*(Hco*ST(t,1) + Qse(t,1));
B(10,1) = (-1)*Aw*(Hco*ST(t,1) + Qsw(t,1));
B(15,1) = (-1)*As*(Hco*ST(t,1) + Qss(t,1));
B(20,1) = (-1)*An*(Hco*ST(t,1) + Qsn(t,1));
B(27,1) = (-1)*Ar*(Hcr*ST(t,1) + Qsr(t,1));
B(28,1) = (-1)*(Qse(t,1)*Awe + Qsw(t,1)*Aww + Qss(t,1)*Aws);
B(29,1) = (-1)*(Qt(t,1))-(V*ACH*RHO*CP*1000*OT(t,1));
X = A\B;
end
I want to be able to store the values of the X matrix (29,1) of each interation into an a table of (29,24) so that i can plot the results over hour of the day.. each iteration represents the hour of the day.
Please Help!!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!