Date: Feb 5, 2013 10:36 AM
Author: Steven Lord
Subject: Re: Polynomial modeling in 3 dimensions



"Hayfa " <hayfa_blaiech@hotmail.fr> wrote in message
news:keqols$12b$1@newscl01ah.mathworks.com...
> Hello,
> While running this code I have this error
> img=imread('test5.jpg');
> figure(1);imshow(img);
> img1=im2double(img);
> img2=rgb2gray(img1);
> figure(2);imshow(img2);
> save img2
> load('img2.mat');
> figure(3);surf(img2)
> figure(4);mesh(img2)
> title('Le signal de l''image')
> x=1:600
> y=1:800
> z=img2(x,y)
> p=polyfitn([x(:),y(:)],z(:),3)
>
>
> ??? Error using ==> horzcat
> CAT arguments dimensions are not consistent.
>
> Can someone help me to resolve this error


You can't have a matrix whose first column has 600 elements and whose second
has 800. You will probably need to turn x and y into (600*800) element
vectors with MESHGRID in order to use that POLYFITN call.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com