Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Matlab code: I have two vectors like X=[ 0 1 2 3]; y=[ 0 1 2 3]; [X,Y]=meshgrid(x,y); Z=[ -1 2 3 4, -4 5
Matlab code:
I have two vectors like
X=[ 0 1 2 3];
y=[ 0 1 2 3];
[X,Y]=meshgrid(x,y);
Z=[ -1 2 3 4, -4 5 6 7; 4 -5 -6 3; 1 2 -3 4];
surf(X,Y,Z);
view(2);
I would like to plot the positive values of Z using red points and negative values of Z using blue points.
maybe we can add in the code If Z>0 we plot the point using red color and if Z<0 we plot the point using blue color But how Can I code these previous lines, so that I get in my figure xaxis = X y axis =Y and some blue and red points only in my figure at position defined by (X(i),Y(j))
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started