GriddedInterpolant performance, meshgrid vs ndgrid formats

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

Darova, thanks for the edit.
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
Matt J 2021년 3월 10일

0 개 추천

Presumably because ndgridded query data will result in the data being looped through with better memory locality.

카테고리

도움말 센터File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2021년 3월 9일

댓글:

2023년 4월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by