extrapolate the plot to the point out of the interval

8 ビュー (過去 30 日間)
shahab ullah khan
shahab ullah khan 2019 年 5 月 10 日
コメント済み: shahab ullah khan 2019 年 5 月 17 日
I want to extrapolate the plot in the figure to the start point on x-axis, i tried with "interp1" but i could not do that, Please guide in this regard.

回答 (1 件)

John D'Errico
John D'Errico 2019 年 5 月 10 日
編集済み: John D'Errico 2019 年 5 月 10 日
You can't. Well, you can, but interp1 will give you meaningless garbage, as it should.
Extrapolation is a dangerous thing. And extrapolation without intelligence behind it? That equals dangerously meaningless garbage.
Think of it like this: How is any extrapolation to know that your function should behave outside of the interval? Should an extrapolant extrapolate linearly from that last point? Should it somehow be able to know that your curve seems to be an vaguely exponentially decreasing oscillating function? Should it somehow be able to model your function as such?
Computers are generally not intelligent things, unless you provide the intelligence, the knowledge of the process you have plotted. They cannot just look at some data and know how to extrapolate it.
So in order for MATLAB to somehow extrapolate, you must first decide on an appropriate model for that process. Then you would use a tool like the curve fitting toolbox, and estimate the parameters of that model. Finally, you would then evaluate that model at any set of points. Sadly, even having done all of that, your extrapolant need not be very accurately predictive. That is the nature of extrapolation. If we could do it truly well, then we could do things like predict the weather years in advance. Instead, we look outside, and say it looks like it might rain, maybe.
  5 件のコメント
John D'Errico
John D'Errico 2019 年 5 月 16 日
編集済み: John D'Errico 2019 年 5 月 16 日
You should realize that your data is useless for extrapolation as you have posted it?
By writing those numbers out to only 5 significant digits, you have created replicate data, thus duplicate values in x, with what seems to be smoothly varying y. Here is subset of the data from the ends:
1.4551e+10 6.9182e-18
1.4551e+10 7.0748e-18
1.4551e+10 7.2165e-18
1.4551e+10 7.3378e-18
1.4551e+10 7.4334e-18
1.4551e+10 7.4985e-18
1.4551e+10 7.5286e-18
1.4551e+10 7.5195e-18
1.4551e+10 7.4679e-18
1.4551e+10 7.3709e-18
...
1.5708e+10 3.7775e-19
1.5708e+10 6.7912e-19
1.5709e+10 1.1964e-19
1.5709e+10 8.7459e-19
1.5709e+10 2.2978e-19
1.5709e+10 3.8253e-20
1.5709e+10 2.1481e-19
1.5709e+10 8.0683e-20
1.5709e+10 8.3761e-19
1.5709e+10 3.8734e-19
1.5709e+10 2.2553e-19
1.5709e+10 1.2713e-18
1.5709e+10 3.2215e-19
1.5709e+10 2.7337e-19
1.571e+10 1.0491e-18
1.571e+10 2.3649e-19
1.571e+10 3.8928e-19
shahab ullah khan
shahab ullah khan 2019 年 5 月 17 日
Sorry for taking your time jhon, thanks for your kind comment, this time i saved the data in mat file, i plot the data from the mat file, it is working this time. Following code can be used to extract the data from the mat file.
load('myData.mat')
plot(myData.tf,myData.flux)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeBartlett についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by