Prev: Writing a matrix with header into a CSV/XLS file
Next: having "is not a valid win32 application" error message on newer matlab version
From: Walter Roberson on 6 May 2010 17:40 Matteo wrote: > I think a better suited question for my case would be: Is there any way to automatically detect if the input matrix of raw data (which is in double format, by the way) does not have the range of values that would normally be expected for an intensity image (0 to 1)? And if so, convert it to that scale using mat2gray. > For instance, one of my matrices have data between negative 5.9834 and positive 2.9969. if any(abs(MatrixName(:)) > 1)
From: Matt Fig on 6 May 2010 18:08 if any(A(:)<0 | A(:)>1)
From: Walter Roberson on 6 May 2010 18:46 Matt Fig wrote: > if any(A(:)<0 | A(:)>1) Ah, yes, you are correct, Matt... I got caught mentally thinking of the valid range for normalized sound files.
From: Matteo on 6 May 2010 17:58
Thank you both, this is very helpful! :-) |