Removing checkmonotonic for improving performance
Show older comments
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
Accepted Answer
More Answers (1)
Bjorn Gustavsson
on 21 Jan 2014
0 votes
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
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!