In reply to Blue Straggler: I have very limited knowledge of Matlab, so could be very wrong, but are you using the range command correctly?
http://www.geo.cornell.edu/grads/duncan/gcm/anal/matlab/range.html suggests that range command is used to find the range of values in an array, rather than to define the minimum and maximum values you want to extract.
I'm not sure how you'd do what you want though - I'll have a scout around and see what I can suss.