How do a plot the surface given by e^-(y)*cos(x) in scilab?

31 views Asked by At

I want to plot a 3d surface in scilab with this profile: e^(-y)*cos(x). I plotted in geogebra and it gone allright, but when I try it in scilab it returns another surface that does not correspond to the geogebra plot

I was trying to plot this surface in scilab to get something like that:

geogebra plot

But, instead, what i get is this:

scilab plot

my code is:

x=[-10:0.1:10]; y = [-10:0.1:10];

[X,Y] = meshgrid(x,y)

Z = (%e^(-Y)).*cos(X)

surf(X,Y,Z, 'facecol','blue','edgecol','black')

1

There are 1 answers

0
Serge Steer On

You should use exp(-Y) instead of %e^(-Y) because %e^(-Y) computes the matricial exponent instead of elementwise exponent.