How to extrapolate given data to find more number of points?

5 views (last 30 days)
I have a set of data for example
  1. X Y
0 45
2 38
6 34
I want to find values of y for x=8,10, 12 etc. Is there any way to do it in MATLAB

Answers (1)

John D'Errico
John D'Errico on 6 Aug 2022
Your words ask how to do interpolation. However, then you ask about extrapolation. The two problems are VERY different.
To quote Mark Twain (Life on the Mississippi) on the dangers of extrapolation...
"In the space of one hundred and seventy-six years the Lower Mississippi has shortened itself two hundred and forty-two miles. That is an average of a trifle over one mile and a third per year. Therefore, any calm person, who is not blind or idiotic, can see that in the Old Oolitic Silurian Period,' just a million years ago next November, the Lower Mississippi River was upwards of one million three hundred thousand miles long, and stuck out over the Gulf of Mexico like a fishing-rod. And by the same token any person can see that seven hundred and forty-two years from now the Lower Mississippi will be only a mile and three-quarters long, and Cairo and New Orleans will have joined their streets together, and be plodding comfortably along under a single mayor and a mutual board of aldermen. There is something fascinating about science. One gets such wholesale returns of conjecture out of such a trifling investment of fact."
You can use interp1 to perform interpolation. However, extrapolation is a dangerous thing. You are best off to choose an intelligent and APPROPRIATE model, fit it to your data, then use it for extrapolation.

Community Treasure Hunt

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

Start Hunting!

Translated by