interpolating over vectors and matrices
1 回表示 (過去 30 日間)
古いコメントを表示
Consider the following example:
time = 1/24:1/24:365;
period = 0:0.0232:1.964;
power = 0 + (1-0)*rand(85,8760);
pcolor(time,period,power);shading interp
This example shows how the power of a certain periodicity ('period') from a signal changes in time. From this I would like to perform some further analysis on a period that lies between 2 of the period shown above. I would like to look closer at how the power at a period of 0.0417 changes in time. However, this period lies between period(2) and period(3). Is there a method for interpolating over the vector 'period', and matrix 'power' to generate a reasonable estimate of the power at 0.0417?
0 件のコメント
採用された回答
Sean de Wolski
2012 年 8 月 14 日
[pp tt] = ndgrid(period,time);
G = griddedInterpolant(pp,tt,power);
G(0.0417,3)
This is making the assumption that you want a two dimensional interpolation. If you would like a one dimensional interpolation across columns, you can use interp1 directly.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!