find missing points on a graph

2 ビュー (過去 30 日間)
talayeh ghodsi
talayeh ghodsi 2019 年 6 月 13 日
コメント済み: KSSV 2019 年 6 月 13 日
hi every body. I have written this code
a=[1,3,4,6,7,9]
b=[2,12,24,32,41,49]
plot(a,b,'r-')
hold on
plot(a,b,'ko','LineWidth',2,'DisplayName','KnownCorrespondence')
i want to find 3 points on the above graph which i have the a values of them only
a_missing=[2,5,8]
how can i find the b_missing values correspond to a_value on the graph?

採用された回答

KSSV
KSSV 2019 年 6 月 13 日
a=[1,3,4,6,7,9]
b=[2,12,24,32,41,49]
plot(a,b,'r-')
hold on
plot(a,b,'ko','LineWidth',2,'DisplayName','KnownCorrespondence')
% get missing
x = min(a):max(a) ;
missing = setdiff(x,a)
  2 件のコメント
talayeh ghodsi
talayeh ghodsi 2019 年 6 月 13 日
sorry sir. i dont want to find the missing data of a, i know them that are 2,5,8.
i want the y values of them to find the points in order to be on the graph.
i have the plot and the x values on them, i want to find the y values
KSSV
KSSV 2019 年 6 月 13 日
Simple use interp1. Read about it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by