matlab enlarge matrix
hi,
if i understand you rigth, you want to zero pad a matrix, rigth.
well usaly you do it in order to do soom calc on it, and most of the matlab function do contain another argomant that tells them to zeropad it's inputs before using it.
so you should chack with the help XX about whtere your function has this,
and any way here's a code that does conv on a pic with a mask. and then in order to do mac on the frq plane we had to do fft and zeropading before it and it was done like this:
I=imread('cameraman.tif'); %Read Image
subplot(2,1,1);imshow(I)
h=ones(9);
% h=[0 -1 0; -1 4 -1; 0 -1 0];
J=conv2(I,h,'full');
subplot(2,1,2);imshow(J,[])
[m,n]=size(J);
FI=fft2(I,m,n);figure
subplot(2,2,1);imshow(log(abs(fftshift(FI))+1),[])
% [m,n]=size(I);
% h(m,n)=0; %Zero padding
Fh=fft2(h,m,n);
subplot(2,2,2);imshow(log(abs(fftshift(Fh))+1),[])
FJ=FI.*Fh;
Jfreq=ifft2(FJ);
subplot(2,2,3);imshow(log(abs(fftshift(FJ))+1),[])
subplot(2,2,4);imshow(real(Jfreq),[])
that's for doing an fft with zeropading.
hope that's help,
iftah.