Combine griddedInterpolants on the same grid
Mostrar comentarios más antiguos
I'm wondering if there is a way to combine griddedInterpolants on the same grid.
I have uniform ngrids (201-by-201) for x and y and three different z-grids (surfaces) 201-by-201-by-3.
To querry all three z-values for a x-y-pair I can loop through three Interpolants but is there an faster/ smarter way?
% Show plots
surf(xGrid,yGrid,zGrid(:,:,1))
surf(xGrid,yGrid,zGrid(:,:,2))
surf(xGrid,yGrid,zGrid(:,:,3))
% Interpolant for each z-surface
C(1).F = griddedInterpolant(xGrid,yGrid,zGrid(:,:,1));
C(2).F = griddedInterpolant(xGrid,yGrid,zGrid(:,:,2));
C(3).F = griddedInterpolant(xGrid,yGrid,zGrid(:,:,3));
% Querry points, eg
x = 4;
y = -1;
for i = 1 : 3
out(i) = C(i).F(x,y);
end
Respuesta aceptada
Más respuestas (1)
Bruno Luong
el 20 de Oct. de 2020
0 votos
If you know in advande the reference gridded points and the query points, (but the z data change), you migh build one ce interpolation matrix, then multiply by the data to retrieve the interpolation values. See this thread
1 comentario
Konrad Warner
el 20 de Oct. de 2020
Editada: Konrad Warner
el 20 de Oct. de 2020
Categorías
Más información sobre Time Series Collections en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!