Interpolating a velocity field between time steps
이전 댓글 표시
Hi! I am a relatively new user of Matlab, working on a project of particle advection in a hydodynamic environment. In order to simulate the advection I have to interpolate current velocities between time steps. I have a field of mean current velocities for each day. I want to split the day into 4 hour intervals, hence I would need to interpolate the velocities at 5 extra time steps. My velocity matrix is named MER.u (92x100x15), where the third dimension represents each day (15 in total). When trying to interpolate I am returned with an error ("The grid vectors do not define a grid of points that match the given values.").
I am struggling to construct a sentence where I would tell Matlab to treat MER.u(:,:,it), to be the corresponding value of MER.mt(1). I am aware that a date giving a field of velocities is not exactly a function but I was assuming linear 1D interpolation is the correct method for this (of course I could and likely am wrong). Can you please help with this, it should be fairly easy.
The code I am using is given bellow.
%MER.mt is a vector of 15 dates in datenum format
%MER:u is a grid 92x100x15 of velocities for 15 days
tn= [MER.mt(1):1/6:MER.mt(end)] ;
interp1(MER.mt, MER.u, tn);
댓글 수: 2
KSSV
2016년 3월 1일
You have a grid of 92X100. There is spatial variation as well as temporal variation. How you can use interp1? Give more information about the problem and data you have.
Timotej Turk Dermastia
2016년 3월 1일
편집: Timotej Turk Dermastia
2016년 3월 1일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!