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

1 visualizzazione (ultimi 30 giorni)
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 = ?

Risposte (1)

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

Accedi per commentare.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by