Removing checkmonotonic for improving performance
Mostrar comentarios más antiguos
Hi all,
I am trying to speed up a code I have written. I need to use interp3 to interpolate images into a 8connected neighborhood. When using profile I see 20% of time is spent calling checkmonotonic function. As far as I have understood from line comments availables it just checks whether provided grid components are monotonically increasing or not. This is part of the code where I create inputs for interp3:
[a,b,c]=meshgrid(1:2,1:2,1:2);
tmp=linspace(1,2,5);
[A,B,C]=meshgrid(tmp,tmp,tmp);
...
NewDxyz=interp3(a,b,c,Vxyz,A,B,C);
Here is the question: given that I am sure my input grid is fine (am I right? ), could I just remove this checking step to speed up my code?
Best,
Alessandro
Respuesta aceptada
Más respuestas (1)
Bjorn Gustavsson
el 21 de En. de 2014
0 votos
Alessandro, have a look at the file exchange for the interpolation submissions, maybe some of those suits your needs. On the other hand, maybe your application is simple enough for blunt hard-coding, if so that might be fastest this time - if you dont need any bells and whistles...
HTH
Categorías
Más información sobre Resizing and Reshaping Matrices 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!