Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Steven Lord

Posts: 17,944
Registered: 12/7/04
Re: Polynomial modeling in 3 dimensions
Posted: Feb 5, 2013 10:36 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



"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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.