How to find corresponding value in Y vector for a non given value in X vector?

1 次查看(过去 30 天)
Suppose I have 2 vectors, A = [180 230 260 300 360] B = [1.2 3.2 5.6 7.9 9.1]
How do I find value of B for a value of A which is not given? For eg. A = 210.22, B = ?

回答(1 个)

KSSV
KSSV 2017-8-27
Do interpolation....doc interp1..
Bi=interp1(A,B,210.22)
  2 个评论
Aniket Raje
Aniket Raje 2017-8-27
Hi, Thanks for your Answer. How I find for a value that is beyond the limits of the A vector? Such as 130?
KSSV
KSSV 2017-8-28
It s very much given in the documentation.....I asked you to read the documentation.
Bi = interp1(A,B,130,'linear','extrap')
But note that...you should be careful with the extrapolation.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by