Using a matrix in scatteredInterpolant

3 views (last 30 days)
H ZETT M
H ZETT M on 11 Jan 2017
Commented: Jyotish Robin on 18 Jan 2017
Hey guys, so I got the following problem: I want to interpolate my matrix (size 220x180x1801) onto a new grid (of course size 220x180). So I am currently using griddata and it is pretty slow. It looks like this:
for i=1:length(time)
u_grid(:,:,i)=griddata(longitude,latitude,wind_x(:,:,i),lon,lat);
end
I wanted to try and use scatteredInterpolant, because matlab tells me it has a better performance. But when I try to use it, I get the error "The input points must be specified in column-vector format." So is there any way to use a matrix as input, because using another for-loop to do the column-vector stuff would probably slow down everything.
  1 Comment
Jyotish Robin
Jyotish Robin on 18 Jan 2017
The error you describe is usually due to passing data of inconsistent dimensions.
Maybe you could try using the 'griddedInterpolant' class to perform interpolation.
More information is in the link below:
Hope it helps!

Sign in to comment.

Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!