contour plot problem Z must be at least a 2x2 matrix
Ältere Kommentare anzeigen
Hallo everyone,
i have a problem to make the contour plot, it always shows Z must be at least a 2x2 matrix. i have try my best to solve, but it still not work, could you please to help me? The code is as follows.
x=[80;100;90;90;90]
y=[4;4;2;6;4]
[X,Y] = meshgrid(x,y)
% Polly 11 f(x,y)=p00+p10*x+p01*y
f1=1.7419-0.0006*x+0.0132*y
contour(X,Y,f1)
Thanks and best regards
JL
Akzeptierte Antwort
Weitere Antworten (1)
x=[80;100;90;90;90];
y=[4;4;2;6;4];
[X,Y] = meshgrid(x,y);
% Polly 11 f(x,y)=p00+p10*x+p01*y
f1=1.7419-0.0006*X+0.0132*Y;
contour(X,Y,f1)
4 Kommentare
JM
am 25 Jul. 2024
Walter Roberson
am 25 Jul. 2024
Your original code used
f1=1.7419-0.0006*x+0.0132*y
which refers to the vector x and y
The revised code uses
f1=1.7419-0.0006*X+0.0132*Y;
which refers to the grids X and Y
Walter Roberson
am 25 Jul. 2024
Your plot is similar to what you would get if you used surfc
JM
am 25 Jul. 2024
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




