I'm running the example you have in the comments of your code:
% Example 2: 1000 x 1000 random data
toc % about 0.5 seconds
And it's taking substantially longer than a few seconds to solve, more like 40 seconds. This is on a fairly new Intel core i5-2400 3.10GHz processor with 64-bit Windows 7 and 16 Gb RAM.
In your great amount of experience optimizing your code here, could you suggest a reason why this may be taking so long to compute?
04 May 2013
PROGRAM CONSTRUCTS A JPEG FILE FROM THE INPUT BMP,TIFF FILE FORMATS.