I am trying to use interp3 on scatter data, and I'm getting the error:
Error using griddedInterpolant
The grid vectors are not strictly monotonic increasing.
Command:
[x,y,z] = meshgrid(0:0.25:1,0:0.25:1,0:0.25:2);
I3D=interp3(scatter(:,1),scatter(:,2),scatter(:,3),scatter(:,4),x,y,z,'linear');
Any idea what the issue is? I've done the same thing with 2D data using 'griddata', not sure why MATLAB is angry.
Thanks in advance!

 채택된 답변

Walter Roberson
Walter Roberson 2015년 12월 8일

0 개 추천

Your scatter(:,1), scatter(:,2), scatter(:,3) each need to be in monotonic increasing order.
If you are attempting to interpolate a scattered set of values to a grid, you need to use one of the scattered interpolant routines, not a gridded interpolant line interp3()

추가 답변 (1개)

J M
J M 2015년 12월 8일
편집: Walter Roberson 2015년 12월 8일

0 개 추천

Sigh. Indeed. Thank you both.
F=scatteredInterpolant(scatter(:,1),scatter(:,,2),scatter(:,,3),scatter(:,,4));
I=F(a1,a2,a3);
Best way to plot values for 3 spatial dimensions?

카테고리

도움말 센터File Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

질문:

J M
2015년 12월 8일

댓글:

2015년 12월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by