The description of your problem is very lean. Posting a copy of the resulting image would be a good idea.
Please try this:
factor = 1.5;
for j = 1:4
disp(round(1+(j-1)*fator));
end
This means, that e.g. the 2nd row and column of the created image do not get any value and have therefore the value 0. A solution would be to run the loopover the coordinates of the output image and divide the coordinates of the input image by "factor". The speed will be dramatically higher, if you pre-allocate the output arry:
imagem2 = zeros(round(lin*factor), round(col*factor), 3)
But much more efficient is using INTERP2 or IMRESIZE.
Best Answer