Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Issue with horzcat
Date: Tue, 14 Apr 2009 17:10:04 +0000 (UTC)
Organization: Xoran Technologies
Lines: 27
Message-ID: <gs2g1c$k4g$1@fred.mathworks.com>
References: <gs10ep$1vr$1@fred.mathworks.com> <gs1191$q0a$1@fred.mathworks.com> <gs2ah1$ff4$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 1239729004 20624 172.30.248.38 (14 Apr 2009 17:10:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 14 Apr 2009 17:10:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:532690


"Jeff " <jhajewsk@indiana.edu> wrote in message <gs2ah1$ff4$1@fred.mathworks.com>...
> "Matt Fig" <spamanon@yahoo.com> wrote in message <gs1191$q0a$1@fred.mathworks.com>...
> > Since you give the dimensions, I will give it a try:
> > 
> > 
> > >> ortPMat = rand(2,51);
> > >> newPoint = rand(2,1);
> > >> horzcat(ortPMat,newPoint);
> > >> 
> > 
> > 
> > No problem.  Why are you taking the transpose?
> 
> Well ortPmat is a 51X2 matrix so I have to take the transpose to make it 2X51. I don't know a lot of the in depth details of Matlab but transposing a matrix AFTER I have matlab output its size affects the size that is put out (at least that is what was happening last night). Thanks a lot for your help
-----------------

At this point, one can only assume that the efforts you made to determine the actual dimensions of the matrices were unsuccessful. Something may have happened to change the matrices between the time when you displayed them and the line where your code crashes.

The thing to do is to type

>>dbstop if error

and then rerun the code. When the code crashes, you will get the K>> prompt at which point you should type

K>>whos ortPMat newPoint

This will display the matrices' dimensions at the actual point in the code where the crash occurs.