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개)

KSSV
KSSV 2021년 3월 31일
편집: KSSV 2021년 3월 31일

1 개 추천

x = b(:,1) ;
y = b(:,2) ;
xi = linspace(min(x),max(x),4095)' ;
ai_b = interp1(x,y,xi);

댓글 수: 4

Shital Inmulwar
Shital Inmulwar 2021년 3월 31일
Thanks for the response.
It is showing an error as ' the input must be scalar for linspace '
Shital Inmulwar
Shital Inmulwar 2021년 3월 31일
Actually I have used same code for another material as well but for both I have loaded different mat files and then wrote the above stated code accordingly.
But it is showing error as:
Error using griddedInterpolant. The grid vectors must contain unique points.
KSSV
KSSV 2021년 3월 31일
Type error..edited the code......If it works fine else attach your data.
KSSV
KSSV 2021년 3월 31일
Without data how to run?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

2021년 3월 31일

댓글:

2021년 3월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by