For histogram equalization, use histeq() or adapthisteq(), both in the Image Processing Toolbox. To load an image, use imread(). To convert into a 1D array, just do
array1D = array2D(:);
or use the reshape() function.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!