any alternative function to speed up the interpolation process? because interp1 is very slow?
21 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Omar Alngar
el 18 de Jun. de 2016
Respondida: John D'Errico
el 18 de Jun. de 2016
my data is not evenly spaced . I made it as a monotonic increasing, and interp 1 works correctly, but it is very slow. Thanks in advance.
0 comentarios
Respuesta aceptada
John D'Errico
el 18 de Jun. de 2016
The crystal ball is so foggy.
1. We have no idea how much data you have. Big problems take longer to solve. Sometimes you just need to accept that fact, and get some coffee while you wait.
2. We have no idea what method you are using in interp1. pchip will be faster than spline. Linear faster yet.
3. We have no idea how you are calling it. For example, are you calling with ONE point at a time, using a spline method, but on the same set of data? This will force interp1 to recompute the spline over and over again.
If 3 is the case, then create an interpolant using a tool like spline or pchip IN ADVANCE. Then use tools like ppval to evaluate the spline. This avoids recomputing the spline repeatedly.
If your data is changing constantly, and you need to use a smooth interpolant, then accept that it will take longer than you wish, or use a lower order interpolant which will be faster.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Interpolation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!