Error using plot, Data must be a single input

30 次查看(过去 30 天)
x211 = linspace(-5,5,100);
x221 = linspace(-5,5,100);
f22 = 100*(x221-x211.^2).^2 + (1-x211).^2;
plot(x211,x221,f22);
hold on;
plot(S_space(:,2),S_space(:,3),S_space(:,4),'ro-')
% If I use above partial code, then
% Error using plot. Data must be a single input of y-values or one or more pairs of x- and y-values.

采纳的回答

MJFcoNaN
MJFcoNaN 2022-4-23
For 3D data, you should use plot3
x211 = linspace(-5,5,100);
x221 = linspace(-5,5,100);
f22 = 100*(x221-x211.^2).^2 + (1-x211).^2;
plot3(x211,x221,f22);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by