MATLAB: I wrote a script with the function surf but the screen do

3d plots

x= linspace(-5,5,51);
y= linspace(-5,5,51);
[X,Y]= meshgrid(x, y);
S= sinExp(X,Y);
surf(X,Y,S)
xlabel('x')
ylabel('y')

Best Answer

We really need to see your ‘sinExp’ function.
If it is not producing the matrix you expect, be sure you are using element-wise operations, for instance .* instead of *, ./ instead of /. See the documentation on Array vs. Matrix Operations for details.
Related Question