Storing all values into an array
Mostrar comentarios más antiguos
So I'm working on this code to help me with a class, and it works except for the fact that it doesn't store all of my x answers into the array, it only stores the last one. Any suggestions would be so helpful, oh I'm using the R2012a on a macbook pro (don't really know if you need this info)
n = 1;
x = 0;
for n = 1:365
w = 45;
B = (n-1)*(360/365);
d = (180/pi)*(0.006918-00.399912*cos(B)+0.070257*sin(B)-0.006758*cos(2*B)+0.000907*sin(2*B)-0.002697*cos(3*B)+0.00148*sin(3*B));
c = x;
x = sin(d)* sin(o)*cos(t) - sin(d)*cos(o)*sin(t)*cos(s) + cos(d)*cos(o)*cos(t)*cos(w) + cos(d)*sin(o)*sin(t)*cos(s)*cos(w) + cos(d)*sin(t)*sin(s)*sin(w);
%plot (d,x);
A = [45 x]
end
n = n+1;
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Type Identification 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!