Can interp1 function be used when the time interval of data isn't uniform?

7 ビュー (過去 30 日間)
Swasti Khuntia
Swasti Khuntia 2012 年 8 月 20 日
In the interp1 function, yi = interp1(x,Y,xi,method), I have x as time vector with non-uniform interval. But the length of x and Y vectors are same. Can I use the interp1 function to interpolate the data?

採用された回答

José-Luis
José-Luis 2012 年 8 月 20 日
Yes, but the longer your interval the more uncertain your results.
  4 件のコメント
Walter Roberson
Walter Roberson 2012 年 8 月 20 日
All line segments have the same number of mathematical points ("the infinity of real numbers"), so the potential mathematical variability over any line segment is the same as for any other line segments. One cannot generalize about uncertainty over different intervals without knowing the process responsible for the variability.
As a quick example, the uncertainty of the sinc() function over short intervals near 0 is much greater than the uncertainty over long intervals at large x. Larger intervals are not always more uncertain.
José-Luis
José-Luis 2012 年 8 月 20 日
編集済み: José-Luis 2012 年 8 月 20 日
I see your point. It depends on what you are modelling or measuring of course. However, even if you (think) you know your process, there is the problem of unknown unknowns. Unless the system is a very simple one, things will arise that will surprise you, therefore the more uncertainty the larger the interval. And if you are sure of how it works, then why would you need to measure? It all depends on your perspective (as always), and it is an interesting discussion, but maybe overkill for the question of the op.

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

その他の回答 (1 件)

Matt Fig
Matt Fig 2012 年 8 月 20 日
When I have a question like this, I just do a little experiment.
x = sort(rand(1,30)*2*pi); % Non-uniform data
y = sin(x); % Underlying function
xi = 0:.25:2*pi; % Interpolation points
yi = interp1(x,y,xi,'spline');
plot(x,y,'*r',xi,yi,'b')

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by