Mudanças entre as edições de "Si2:Aula2"
De WikiLICC
m (Criou página com 'N =10; x1=-2; x2= 2; y1=-2; y2= 2; for i=1:N for j=1:N r = (i-1)/(N-1); s = (j-1)/(N-1); x(i,j)=x1 *r + x2*(1-r); y(i,j)=y1 *s + y2*(1-s); xv(i) =x(i…') |
m |
||
Linha 1: | Linha 1: | ||
− | N =10; | + | N =10; |
− | x1=-2; | + | x1=-2; x2= 2; |
− | x2= 2; | + | y1=-2; y2= 2; |
− | y1=-2; | ||
− | y2= 2; | ||
− | + | for i=1:N | |
− | for i=1:N | + | for j=1:N |
− | + | r = (i-1)/(N-1); | |
− | + | s = (j-1)/(N-1); | |
− | + | x(i,j)=x1 *r + x2*(1-r); | |
− | + | y(i,j)=y1 *s + y2*(1-s); | |
− | + | ||
− | + | xv(i) =x(i,j); | |
− | + | yv(j) =y(i,j); | |
− | + | z(i,j)=1-x(i,j)-y(i,j); | |
− | + | end | |
− | + | end | |
− | end | + | |
− | + | surf(x,y, z,'facecol','interp') | |
− | surf(x,y, z,'facecol','interp') | + | |
− | + | fig = gcf(); | |
− | fig = gcf(); | + | fig.color_map=coolcolormap(32); |
− | fig.color_map=coolcolormap(32); | + | contour2d( xv,yv, z,20) |
− | contour2d( xv,yv, z,20) |
Edição das 13h44min de 17 de agosto de 2010
N =10; x1=-2; x2= 2; y1=-2; y2= 2;
for i=1:N for j=1:N r = (i-1)/(N-1); s = (j-1)/(N-1); x(i,j)=x1 *r + x2*(1-r); y(i,j)=y1 *s + y2*(1-s); xv(i) =x(i,j); yv(j) =y(i,j); z(i,j)=1-x(i,j)-y(i,j); end end surf(x,y, z,'facecol','interp') fig = gcf(); fig.color_map=coolcolormap(32); contour2d( xv,yv, z,20)