Filter löschen
Filter löschen

Line and scattered data on one plot

1 Ansicht (letzte 30 Tage)
Daniel
Daniel am 17 Feb. 2016
Beantwortet: Walter Roberson am 17 Feb. 2016
I have three polynomials,
y_150 = @(x) 22*((x-23)/4.9)^4 - 48*((x-23)/4.9)^3 + 27*((x-23)/4.9)^2 - 37*((x-23)/4.9) + 40;
y_200 = @(x) 11*((x-19)/4.8)^4 - 48*((x-19)/4.8)^3 + 73*((x-19)/4.8)^2 - 72*((x-19)/4.8) + 48;
y_212 = @(x) 23*((x-19)/4.8)^4 - 43*((x-19)/4.8)^3 + 22*((x-19)/4.8)^2 - 40*((x-19)/4.8) + 41;
Which I plot using ,
for i = 9:1:25
n = n + 1;
y_15(n) = y_150(i);
y_20(n) = y_200(i);
y_21(n) = y_212(i);
end
figure;
plot(9:1:25,y_15)
hold on
plot(9:1:25,y_20)
hold on
plot(9:1:25,y_21)
But, now I use these curves to calculate certain events. eg,
life_log{event_log} = [n_yaw(i,2) y_150(n_yaw(i,2))];
I then end up with a cell array,
life_log = [9,1041] [12,506] [12,506] [12,506] [15,191] [15,191] [15,191] [15,191] [21,63] [9,1041] [9,1041] [9,1041];
Which I then transform into a matrix,
life = cell2mat(life_log');
So... My question is how do I plot these scattered points on the same graph of the curves?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 17 Feb. 2016
You already have "hold on" in effect, so just
scatter(life(:,1), life(:,2))

Weitere Antworten (0)

Kategorien

Mehr zu Discrete Data Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by