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

1 visualización (últimos 30 días)
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 = ?

Respuestas (1)

KSSV
KSSV el 27 de Ag. de 2017
Do interpolation....doc interp1..
Bi=interp1(A,B,210.22)
  2 comentarios
Aniket Raje
Aniket Raje el 27 de Ag. de 2017
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 el 28 de Ag. de 2017
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by