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.
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!