soren at hauberg.org
soren at hauberg.org
Mon Aug 4 04:30:09 CDT 2008
Quoting bharat pathak <bharat at arithos.com>:
> I can do that, but I just want to know how one should
> write the code such that it is extremely efficient.
>
> In other words, can some experts prepare "Tips and Tricks"
> document for "Efficient Octave Programming".
I don't think you'll end up with something that's much better than
what Jaroslav suggested. As to a good reference, then I believe
Mathworks has a nice tutorial on vectorising your code. Try looking at
their documentation (it's available online).
> My functions are still consuming 1.3 seconds, which is
> prohibitively high if someone intends to process 200
> images.
I've tried your code on my machine at work, and it returns almost
instantly. So either my machine is much faster than yours, or
something seems broken with your setup. Matrix based code can be
fairly memory intensive, so perhaps this is your problem? If you
store, say, 200 images in memory at the same time, this could affect
performance quite a bit.
Søren
More information about the Help-octave
mailing list