Add Interpolated Vector to Matrix
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Gonzo Gonzo
el 7 de Mayo de 2020
Comentada: Gonzo Gonzo
el 7 de Mayo de 2020
Hi,
I'm trying to interpolate velocity values over a range of heights and times to then save it into a matrix. I'm having trouble getting the data to save/interpolate properly.
When I used Ninterp(:,t) = interp2(ADCP.t,ADCP.Depth,ADCP.N,time_in,Z); I was able to get it to work for t=1:1:100, however I need it to work for different time steps then just 1.
ADCP.N - North velocity values as a function of depth and time (82x1000)
ADCP.t - datenum time vector from the sensor
ADCP.Depth - depth of water column
time_in - an arbitrary time vector (may not be an integer) to interpolate through
Z - an arbitrary range of heights to interpolate through
Z = [150:-1:1];
Nq = zeros(length(ADCP.t));
for t=1:.25:100
time_in = tStart+datenum([0,0,0,0,0,t]);
Ninterp = interp2(ADCP.t,ADCP.Depth,ADCP.N,time_in,Z);
Nq = Ninterp(t)
end
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
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!