find missing points on a graph
5 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
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)
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!