interpolating over vectors and matrices

1 vue (au cours des 30 derniers jours)
Richard
Richard le 14 Août 2012
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?

Réponse acceptée

Sean de Wolski
Sean de Wolski le 14 Août 2012
[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.

Plus de réponses (0)

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by