MATLAB: Original image size 769*770, I am geting error as dimension mismatch

i am geting error as dimension mismatchoriginal image size 769*770

Original image size 769*770
org_im=imread('picture1.jpg');
[rows,columns,numberofcolorbands]=size(org_im)
if numberofcolorbands >1 org_im=org_im(:,:,2); end
org_im=im2double(org_im);
figure(1); imshow(org_im);title('Original Image')
f=zeros(771,772); [m,n]=size(f); f(769,770)=size(org_im);
I am getting an error as,
Subscripted assignment dimension mismatch.
Error in sobelmaskspat_d (line 23) f(769,770)=size(org_im);
How to overcome this,
please help me.
Thank you

Best Answer

f(769,770) = size(org_im);
The right hand side replies a vector, but the left hand side is one element of a matrix, a scalar. We cannot guess what this line should do. So please explain this detail.
If you want to pad a matrix by zeros:
f = zeros(771,772);
f(2:770, 2:771) = org_im;