フィルターのクリア

Line and scattered data on one plot

1 回表示 (過去 30 日間)
Daniel
Daniel 2016 年 2 月 17 日
回答済み: Walter Roberson 2016 年 2 月 17 日
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?

採用された回答

Walter Roberson
Walter Roberson 2016 年 2 月 17 日
You already have "hold on" in effect, so just
scatter(life(:,1), life(:,2))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDiscrete Data Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by