http://www.mathworks.com/matlabcentral/newsreader/view_thread/240575
MATLAB Central Newsreader  Is this function available?
Feed for thread: Is this function available?
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Sat, 06 Dec 2008 21:49:00 +0000
Is this function available?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240575#615471
LeanMean82
Hey Guys,<br>
<br>
Quick Question.<br>
I just want to know whether matlab has a function that can create a matrix which is an intersection of column spaces of two original matrices. Such that:<br>
<br>
A has 5 column vectors, B has 3 column vectors. A and B share at least two column vectors and therefore creates a matrix C with these two column vectors. <br>
<br>
Thanks.

Sat, 06 Dec 2008 22:13:02 +0000
Re: Is this function available?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240575#615473
Roger Stafford
LeanMean82 <nndhawan@ufl.edu> wrote in message <852406.1228600170649.JavaMail.jakarta@nitrogen.mathforum.org>...<br>
> Hey Guys,<br>
> <br>
> Quick Question.<br>
> I just want to know whether matlab has a function that can create a matrix which is an intersection of column spaces of two original matrices. Such that:<br>
> <br>
> A has 5 column vectors, B has 3 column vectors. A and B share at least two column vectors and therefore creates a matrix C with these two column vectors. <br>
> <br>
> Thanks.<br>
<br>
Yes. Use the 'intersect' function with the 'rows' option. (You'll have to do some transposing to make it work.)<br>
<br>
Roger Stafford

Sat, 06 Dec 2008 23:03:02 +0000
Re: Is this function available?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240575#615478
David Doria
Roger, I feel like he is talking more about the intersection of the column spaces, not a discrete kind of intersection. Intersect() will just say that two things intersect if they are exactly the same, right? Where the vector spaces intersect in a much more complicated way.<br>
<br>
I could be way off...<br>
<br>
Dave

Sun, 07 Dec 2008 00:35:03 +0000
Re: Is this function available?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240575#615487
Roger Stafford
"David Doria" <daviddoria@gmail.com> wrote in message <ghf0b6$l55$1@fred.mathworks.com>...<br>
> Roger, I feel like he is talking more about the intersection of the column spaces, not a discrete kind of intersection. Intersect() will just say that two things intersect if they are exactly the same, right? Where the vector spaces intersect in a much more complicated way.<br>
> I could be way off...<br>
> Dave<br>
<br>
Here is a quote from the Matlab 7 Function Reference, Vol. 2: "c = intersect(A, B, 'rows') when A and B are matrices with the same number of columns returns the rows common to both A and B." With a transpose understood, you can read that with the words 'rows' and 'columns' interchanged. Nothing is said about the matrices being the same size, only their respective numbers of columns (which translates to rows with the transpose).<br>
<br>
For example, if<br>
<br>
A = [1 2 3 4 5;6 7 8 9 10;11 12 13 14 15] <br>
<br>
and<br>
<br>
B = [5 16 2;10 17 7;15 18 12] <br>
<br>
then C could be calculated as<br>
<br>
C = intersect(A',B','rows')' = [2 5;7 10;12 15].<br>
<br>
I presume from the OP's description, since A and B share two columns in common, that C should consist of just these two columns.<br>
<br>
Roger Stafford

Sun, 07 Dec 2008 02:47:01 +0000
Re: Is this function available?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240575#615494
John D'Errico
"David Doria" <daviddoria@gmail.com> wrote in message <ghf0b6$l55$1@fred.mathworks.com>...<br>
> Roger, I feel like he is talking more about the intersection of the column spaces, not a discrete kind of intersection. Intersect() will just say that two things intersect if they are exactly the same, right? Where the vector spaces intersect in a much more complicated way.<br>
> <br>
> I could be way off...<br>
> <br>
> Dave<br>
<br>
I'd guess that Roger is correct here. The original<br>
question uses the phrase "column space", but<br>
then gives an example that is not consistent with<br>
the linear algebraic definition of a column space.<br>
Intersect does what was described.<br>
<br>
John