I'm sorry if this sounds stupid but I want to make a system that can detect if an image has an object (i.e face) inside it or not. Can you help me with the MATLAB tutorial? Sorry for my bad English.
If your definition of object detection is something that has different pixel values than the background, you could use thresholding (I'd say graythresh is pretty good, or play around with you own values) to find an appropriate level (some number). Then feed that level into the function im2bw as one of the input arguments and you'll get a black and white binary image where your object is white and the background is black.
Shalom,
The normal technique for detecting a face within an image is called histogram backprojection. In plain(ish) language, it works like this: First you create a histogram of a human face (this is typically a 2D hue, saturation histogram from a HSV image, but it could be any kind of histogram). Then you "backproject" that histogram across the image you are searching. This back projection is basically a statistical comparison between each pixel in your search image and your histogram for the human face. You can think of it as a function that asks how likely it is that each pixel contains human face data. The result is a blob image that highlights pixels that are likely to be in a face. The same can be done for groups of pixels. As far as achieving this in matlab ... I don't know if it is the best tool for the job. However, you should take a look at this link. It looks like this dude used matlab.
http://elm.eeng.dcu.ie/~oconaire/source/
This link might also be helpful
If you want a better explanation than my goober ranting, have a look at the openCV book written by Gary Bradski and Adrian Kaehler (it is verynice) http://proquest.safaribooksonline.com/9780596516130/firstchapter#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTk3ODA1OTY1MTYxMzAvMjA5