Interpolation problem with interp1
Mostrar comentarios más antiguos
Hello everyone:)
I have graphic with some missing data, so I interpolated my data vector to fill the gaps but I have this error message " Brace indexing is not supported for variables of this type." and I could not fond the error! So here is the code I used:
for i=1:length(t0)
R{i}=interp1(t{i},R{i},t0,'linear');
end
thanks in advence😊
Respuesta aceptada
Más respuestas (1)
Ravi Narasimhan
el 7 de Sept. de 2021
Editada: Ravi Narasimhan
el 8 de Sept. de 2021
Not sure what your R vector represents but it seems like you are trying to use a loop to interpolate within a one-dimensional array. This is something Matlab does at the array level itself without the need for a loop.
If you look up help interp1 , there's an example of this.
X = 0:10;
V = sin(X);
Xq = 0:.25:10;
Vq = interp1(X,V,Xq);
plot(X,V,'o',Xq,Vq,':.')
X and V have 11 elements.
Xq and the interpolated Vq have 41 elements.
No looping required.
1 comentario
Manal NOURI
el 8 de Sept. de 2021
CategorÃas
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
