Here is the complete solution script:
img = imread('Bubble0.jpg');
GI = rgb2gray(img);
[gx, gy] = gradient(double(GI), .5, .5);
[r, c, LA]=size(img);
figure('name','Gradient');
imshow(img(1:r,1:c),'InitialMagnification','fit');
hold on;
quiver(gx(1:r,1:c),gy(1:r,1:c), 1);
title('Gradient Field');
figure
quiver(gx(1:r,1:c),gy(1:r,1:c), 10);
title('Gradient Field')