Add Interpolated Vector to Matrix
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Gonzo Gonzo
am 7 Mai 2020
Kommentiert: Gonzo Gonzo
am 7 Mai 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 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!