Alternative to interp2
31 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Magnate
el 22 de Jun. de 2024 a las 18:25
Comentada: Magnate
el 17 de Jul. de 2024 a las 13:02
I am trying to interpolate values in a 2d space. But my code is very slow.
I used the tic toc and found that it is because of interp2 being called multiple times. Is there an alternate for it ? that would be faster ?
0 comentarios
Respuestas (2)
Ayush Modi
el 22 de Jun. de 2024 a las 18:28
Editada: Ayush Modi
el 10 de Jul. de 2024 a las 11:34
Hi,
"griddedInterpolant" function will run faster and is recommended by MathWorks as an alternative to calling "interp2" multiple times.
Refer to the following documentation for more information on "griddedInterpolant" function:
John D'Errico
el 22 de Jun. de 2024 a las 18:34
Perhaps you are calling interp2 multiple times in a loop, when a single call with multiple points will be far faster. This would be true also with griddedInterpolant. Both tools will be internally optimized to perform much better in a vectorized way.
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!