How to fix error about interp1?

4 visualizaciones (últimos 30 días)
Shital Inmulwar
Shital Inmulwar el 31 de Mzo. de 2021
Comentada: KSSV el 31 de Mzo. de 2021
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);

Respuestas (1)

KSSV
KSSV el 31 de Mzo. de 2021
Editada: KSSV el 31 de Mzo. de 2021
x = b(:,1) ;
y = b(:,2) ;
xi = linspace(min(x),max(x),4095)' ;
ai_b = interp1(x,y,xi);
  4 comentarios
KSSV
KSSV el 31 de Mzo. de 2021
Type error..edited the code......If it works fine else attach your data.
KSSV
KSSV el 31 de Mzo. de 2021
Without data how to run?

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by