How to fix error about interp1?
이전 댓글 표시
I am getting this errors:
Error using griddedInterpolant. The grid vectors must contain unique points.
Error in interp1 (line 161)
F =griddedInterpolant(X,V,method)
Error in interpolation_diff (line 184)
ai_b = interp1(b(:,1), b(:,2),0:4095);
My code line is:
[r,c] = size(b);
ai_b = interp1(b(:,1), b(:,2),0:4095);
답변 (1개)
x = b(:,1) ;
y = b(:,2) ;
xi = linspace(min(x),max(x),4095)' ;
ai_b = interp1(x,y,xi);
댓글 수: 4
Shital Inmulwar
2021년 3월 31일
Shital Inmulwar
2021년 3월 31일
KSSV
2021년 3월 31일
Type error..edited the code......If it works fine else attach your data.
KSSV
2021년 3월 31일
Without data how to run?
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!