%Simple demonstration of one image face detection operation. clear close all x=imread('test01.jpg'); if (size(x,3)>1)%if RGB image make gray scale try x=rgb2gray(x);%image toolbox dependent catch x=sum(double(x),3)/3;%if no image toolbox do simple sum end end x=double(x