i get error saying that z should be a matrix and not a scalar

1 view (last 30 days)
x = linspace (-1,1); y = linspace (-1,1); [X, Y] = meshgrid(x,y); Z=7*sin(pi.*x).*cos(3*pi.*x);
surf(X,Y,Z ) hold on contour(X,Y,Z) hold off
rotate3d on

Accepted Answer

Stephen23
Stephen23 on 7 Mar 2017
Z=7*sin(pi.*X).*cos(3*pi.*X);

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!