MATLAB: How to resample an image in matlab

Image Processing Toolboximresizematlab resamplingresize

Hello
I want to resample an image in matlab. I use imresample code of by Omer Demirkaya. but I have bellow error.
  • | |Error using griddedInterpolantSample values must be a single or double array.
Error in interp2/makegriddedinterp (line 214) F = griddedInterpolant(varargin{:});
Error in interp2 (line 135) F = makegriddedinterp(X, Y, V, method,extrap);
Error in imresample (line 49) nimg(:,:,i) = interp2(Ox,Oy,img(:,:,i),Nx,Ny,intmethod);| | *
Could you help me how can I resample an image?
Thanks for your help.

Best Answer

Before you start the interpolation, do
img = im2double(img);