I assume that the canny edge is working well but you are surprised by the outcome...
While sobel and prewitt remain in the greyscale (or even color) space, canny tends to present the results binary (aka b/w). Though this is not a precondition.
Still I am working with Matlab 2012R, edge function will perfectly work. But see the arguement image I should be in grayscale form , if it is RGB from error will come. I am sure you tried with colour image, you convert the image first in grayscale then you try.
If you don't mind please share the the ERROR DESCRIPTION....we will fix it.... you pls see the attached screen shot...shows how the result will be....when I tried with edge function.
Surely it will work for an input in binary form..... But edges might vary when you consider binary image instead of gray scale image. But surely you will get the result without any error.
@Abdelrahiem Ahmed Hashem: I too agree to all ..there is absolutely no reason for canny to not work if sobel and prewitt work in your system (I mean by chance if the edge code is not corrupt or overwritten in your system).. Would u mind sharing the error plz?