Add Interpolated Vector to Matrix
3 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!