% Matlab function
% Loads a square image
% Jose A. Rodriguez Serrano 2002
function y=LoadSquareImage(imagefile);
fid=fopen(imagefile, 'r');
y=fread(fid,'short');
side=size(y);
side=sqrt(side(1));
y=reshape(y, [side side]);
fclose(fid);

    Source: geocities.com/pretabbed/code_matlab

               ( geocities.com/pretabbed)