Path: news.mathworks.com!not-for-mail
From: "Jeff Hajewski" <jhajewsk@indiana.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Issue with horzcat
Date: Tue, 14 Apr 2009 18:25:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 37
Message-ID: <gs2kdv$k1j$1@fred.mathworks.com>
References: <gs10ep$1vr$1@fred.mathworks.com> <gs1191$q0a$1@fred.mathworks.com> <gs2ah1$ff4$1@fred.mathworks.com> <gs2g1c$k4g$1@fred.mathworks.com> <gs2icq$b0m$1@fred.mathworks.com> <gs2jaa$gv1$1@fred.mathworks.com>
Reply-To: "Jeff Hajewski" <jhajewsk@indiana.edu>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1239733503 20531 172.30.248.38 (14 Apr 2009 18:25:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 14 Apr 2009 18:25:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 942762
Xref: news.mathworks.com comp.soft-sys.matlab:532719


"Matt " <xys@whatever.com> wrote in message <gs2jaa$gv1$1@fred.mathworks.com>...
> "Jeff Hajewski" <jhajewsk@indiana.edu> wrote in message <gs2icq$b0m$1@fred.mathworks.com>...
> 
> > 45      ortPmat = horzcat(ortPmat', newPoint);
> > K>> whos ortPmat newPoint
> >   Name           Size                    Bytes  Class
> > 
> >   newPoint       2x1                        16  double array
> >   ortPmat        2x51                      816  double array
> > 
> > Grand total is 104 elements using 832 bytes
> > 
> > This error doesn't make sense to me because they have the same number of rows.
> 
> Yes, it does make sense. In a previous post you told us that ortPmat was 51x2, which necessitated the transpose. The above output contradicts this, however. It says that ortPmat is really 2x51. So, it makes perfect sense that ortPmat' is not compatible with newPoint for concatenation.

I took the transpose out and reran the program and here is the output

??? Error using ==> horzcat
All matrices on a row in the bracketed expression must have the 
 same number of rows.

Error in ==> buildCurve at 45
    ortPmat = horzcat(ortPmat, newPoint);

45      ortPmat = horzcat(ortPmat, newPoint);
K>> whos ortPmat newPoint
  Name           Size                    Bytes  Class

  newPoint       2x1                        16  double array
  ortPmat       52x2                       832  double array

Grand total is 106 elements using 848 bytes

The error is in the same line of the code and for the exact same reason. Thanks for your patience. Matt Fig I didn't mean to ignore your post 

Jeff