Error using plot, Data must be a single input

28 views (last 30 days)
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.

Accepted Answer

MJFcoNaN
MJFcoNaN on 23 Apr 2022
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);

More Answers (0)

Categories

Find more on Line Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!