function im2gray does not accept the jpg image, it accepts the image in pixel values
Try the following:
pic = imread('good_day.jpg');
gray_pic = im2gray(pic);
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!