Using a matrix in scatteredInterpolant

4 次查看(过去 30 天)
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 个评论
Jyotish Robin
Jyotish Robin 2017-1-18
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!

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by