Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Issue with horzcat
Date: Tue, 14 Apr 2009 18:35:02 +0000 (UTC)
Organization: Xoran Technologies
Lines: 38
Message-ID: <gs2l0m$khd$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> <gs2kdv$k1j$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1239734102 21037 172.30.248.38 (14 Apr 2009 18:35:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 14 Apr 2009 18:35:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:532724


"Jeff Hajewski" <jhajewsk@indiana.edu> wrote in message <gs2kdv$k1j$1@fred.mathworks.com>...
> "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

You made more changes than what you're telling us. If all you did was change line 45 of buildCurve by removing the tranpose, why is ortPmat now of different dimensions than before?

In any case, there is still no mystery as to why the crash occurred. Since ortPmat has 52 rows (now) and newPoint only has 2 rows, it is clear that they cannot be horizontally concatenated.