Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Polynomial modeling in 3 dimensions
Replies: 1   Last Post: Feb 5, 2013 10:36 AM

 Steven Lord Posts: 18,038 Registered: 12/7/04
Re: Polynomial modeling in 3 dimensions
Posted: Feb 5, 2013 10:36 AM

"Hayfa " <hayfa_blaiech@hotmail.fr> wrote in message
news:keqols\$12b\$1@newscl01ah.mathworks.com...
> Hello,
> While running this code I have this error
> figure(1);imshow(img);
> img1=im2double(img);
> img2=rgb2gray(img1);
> figure(2);imshow(img2);
> save img2
> 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
http://www.mathworks.com