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 0 0 0 0;
0 0 0 0 0 0 2
24 0 0 -2 -24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0
0 0 0 2 36 0 0 -2 -36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0
0 0 0 0 0 0 0 2 48 0 0 -2 -48 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 2 60 0 0 -2 -60 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 72 0 0 -2 -72 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 84 0 0 -2 -84 0 0 0 0;
0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 96 0 0 -2 -96;
0 0 2 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 108];
B=[1000; 1400; 1400; 1600; 1600; 1690; 1690; 1720;
1720; 1760; 1760; 1900; 1900; 2150; 2150; 2700; 2700; 3000; 0; 0; 0; 0; 0; 0;
0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0];
v=inv(A)*B;
i=1;
plot(t,w,'o');
hold on
while i<=(n-1)
a=v(4*i-3);
b=v(4*i-2);
c=v(4*i-1);
d=v(4*i);
x=(i-1)*2:0.01:2*i;
y1=a+b*x+c*(x.^2)+d*(x.^3);
plot(x,y1,'color',[rand,rand,rand]);
i=i+1;
end
No hay comentarios.:
Publicar un comentario