The Math Forum

Search All of the Math Forum:

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

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

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

Advanced Search

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

Posts: 18,038
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 " <> wrote in message
> 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
To contact Technical Support use the Contact Us link on

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.