interpolating over vectors and matrices

1 visualización (últimos 30 días)
Richard
Richard el 14 de Ag. de 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?

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 14 de Ag. de 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.

Más respuestas (0)

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by