Matlab

Solo disponible en BuenasTareas
  • Páginas : 2 (300 palabras )
  • Descarga(s) : 0
  • Publicado : 22 de noviembre de 2011
Leer documento completo
Vista previa del texto
a=2.85; b=3; t=0:2*pi/100:2*pi; r1=sqrt(a^2*cos(2*t)+sqrt(a^4*(cos(2*t)).^2+b^4-a^4));r2=sqrt(a^2*cos(2*t)-sqrt(a^4*(cos(2*t)).^2+b^4-a^4)); x1=r1.*cos(t); y1=r1.*sin(t);x2=r2.*cos(t); y2=r2.*sin(t); hold all plot(x1,y1) plot(x2,y2)

[zt]=meshgrid(-1:0.01:1,0:2*pi/100:2*pi) x=z.*cos(t); y=z.*sin(t); surface(x,y,z) axis equal axis off

%Tableau completo n=2;b=7;

EC=[0 0 0 1 0 0 0.006; 1 0 0 -2000 0 0 0; 0 -0.0005 7 1 0 0 0; 1 0 0 -4000 0 0 0; 10 0 -12000 0 0 0 ; 1 0 0 -12000 0 0 0; 1 0 0 -3000 0 0 0]; Nodos=[1 0;0 1;0 1;2 0;2 0;0 1;12]; m=2*b+n; G=zeros(m,m); g=zeros(m,1); for i=1:b G(i,i)=1; G(b+i,i)=EC(i,1); ifEC(i,2)~=0 G(b+i,EC(i,3))=EC(i,2); end; G(i+b,i+b)=EC(i,4); if EC(i,5)~=0 G(b+i,b+EC(i,6))=EC(i,5);end; g(b+i,1)=EC(i,7); k=Nodos(i,1); j=Nodos(i,2); if k~=0 G(2*b+k,b+i)=1; G(i,2*b+k)=-1; endif j~=0 G(2*b+j,b+i)=-1; G(i,2*b+j)=1;

end end x=linsolve(G,g);

for i=1:b if i
tracking img