# Doubt in plot3d

5 messages
Open this post in threaded view
|

## Doubt in plot3d

 Hi,I'm trying to plot the following function in Scilab:x=[-1:0.01:1];y=[-1:0.01:1];g = x .* sin(4 .* %pi .* x) - y .* sin ( 4 .* %pi .* y + %pi ) + 1;plot3d(x,y,g)but nothing is displayed. What i'm doing wrong? Someone could help me? If yes, how can I put a degrade with several colors?Thanks in advance,Lucio........

Veja quais são os assuntos do momento no Yahoo! + Buscados: Top 10 - Celebridades - Música - Esportes
Open this post in threaded view
|

## Re: Doubt in plot3d

 Try this: x=[-1:0.01:1]; y=[-1:0.01:1]; for i=1:length(x)   for j=1:length(y)     g(i,j) = x(i) .* sin((4*%pi) * x(i)) - y(j) .* sin ( (4*%pi) *  y(j) + %pi ) + 1;   end end   plot3d(x,y,g) YC   Lucio Agostinho Rocha a écrit : > Hi, > > I'm trying to plot the following function in Scilab: > > x=[-1:0.01:1]; > y=[-1:0.01:1]; > g = x .* sin(4 .* %pi .* x) - y .* sin ( 4 .* %pi .* y + %pi ) + 1; > plot3d(x,y,g) > > but nothing is displayed. What i'm doing wrong? Someone could help me? > If yes, how can I put a degrade with several colors? > > Thanks in advance, > > Lucio > ........ > > > ------------------------------------------------------------------------ > Veja quais são os assuntos do momento no Yahoo! + Buscados: Top 10 > > - Celebridades > > - Música > > - Esportes >
Open this post in threaded view
|

## Re: Doubt in plot3d

 In reply to this post by Lucio Agostinho Rocha Lucio Agostinho Rocha a écrit : > Hi, > > I'm trying to plot the following function in Scilab: > > x=[-1:0.01:1]; > y=[-1:0.01:1]; > g = x .* sin(4 .* %pi .* x) - y .* sin ( 4 .* %pi .* y + %pi ) + 1; > plot3d(x,y,g) > > but nothing is displayed. What i'm doing wrong? Someone could help me? > If yes, how can I put a degrade with several colors? > > Thanks in advance, > > Lucio > ........ > > > ------------------------------------------------------------------------ > Veja quais são os assuntos do momento no Yahoo! + Buscados: Top 10 > > - Celebridades > > - Música > > - Esportes > ========= You can also try x=[-1:0.01:1]; y=[-1:0.01:1]; deff("z=g(x,y)","z = x .* sin(4 .* %pi .* x) - y .* sin ( 4 .* %pi .* y + %pi ) + 1") fplot3d(x,y,g) ========= ChV