Question: I tried x= linspace(0, 5); y= linspace(-4, 1); z= x + y - (x.^2 + y.^2); [X,Y] = meshgrid(x,y); surf(X,Y,z) when I run it, I

 I tried x= linspace(0, 5); y= linspace(-4, 1); z= x +

I tried

x= linspace(0, 5);

y= linspace(-4, 1);

z= x + y - (x.^2 + y.^2);

[X,Y] = meshgrid(x,y); surf(X,Y,z)

when I run it, I get this error 'Z must be a matrix, not a scalar or vector.' in surf. I don't think I'm setting x and y correctly.

A. Write a MATLAB script surfaceplot.m that plots the following surface Z for 0 S x, y

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!