GriddedInterpolant performance, meshgrid vs ndgrid formats
5 次查看(过去 30 天)
显示 更早的评论
I have been using griddedInterpolant for a long time now. But, starting today, I got the following warning:
Warning: Query data is in MESHGRID format, NDGRID format will yield better performance.
Convert your query data (Xq, Yq) as follows:
F = griddedInterpolant(. . .);
Xq = Xq'; Yq = Yq';
Vq = F(Xq,Yq);
I searched but have not found any discussion about this performance issue. I am hoping that someone out there can help.
Note that I am fully aware of the difference between MESHGRID and NDGRID formats. I am curious about why the NDGRID format provides an advantage.
My guess is that it has to do with column vs row operations.
Best,
Mark
2 个评论
Bruno Luong
2023-4-2
Oddly to me, this transposition
Xq = Xq'; Yq = Yq';
Vq = F(Xq,Yq)
could be done internaly by griddedInterpolant. Why throwing a warning instead of implementing the recommended fix?
回答(1 个)
Matt J
2021-3-10
Presumably because ndgridded query data will result in the data being looped through with better memory locality.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!