Which is the Matlab equivalent to IDL's function bytscl?
Here is my answer, thanks for the comments, this version may be wrong but anyway the image data looks better.

function [ Y ] = bytscl( X )

m = min( X( : ) ); 
M = max( X( : ) ); 
Top = 255; 

    if isfloat( X ) 
    Fc = ( Top + 0.9999 )*( X - m )/( M - m );
    Y = cast( Fc, 'int8' );
    else
    Ic = ( Top + 1 )*( X - m - 1 )/( M - m ); 
    Y = cast( Ic, 'int8' ); 
    end 

end