Error using plot, Data must be a single input

30 Ansichten (letzte 30 Tage)
H
H am 23 Apr. 2022
Beantwortet: MJFcoNaN am 23 Apr. 2022
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.

Akzeptierte Antwort

MJFcoNaN
MJFcoNaN am 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);

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by