Clc: Clears all output on the command line.
Clear All: Delete all variables.
Close All: Close all graphics windows.
Web = webcam (): Create a webcam object.
Pic =web.snapshot: Capture images with webcam objects.
Det face = vision. Cascade object detector (): Create a face detector.
Imshow(pic): display images.
While true: starts an infinite loop.
Pic=web.snapshot: Capture images with webcam objects.
Pic2=rgb2gray(pic): converts the image into a gray image.
Bbox = step(detface, pic): Use the face detector to detect the face in the image.
Img = InsertObject annotation (PIC, ... rectangle', BBOX,' face'): marks the detected face in the image.
Imshow(img): displays the marked image.
I hope these explanations will help you understand the function of the code.