Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Creating a matrix from information in two other matrixes
Date: Fri, 10 Dec 2010 16:54:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 11
Message-ID: <idtlvd$j0e$1@fred.mathworks.com>
References: <idtaut$j28$1@fred.mathworks.com> <idtc4d$ant$1@fred.mathworks.com> <idtgfm$508$1@fred.mathworks.com> <idthuu$3c1$1@fred.mathworks.com> <idtib5$aj4$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1292000045 19470 172.30.248.35 (10 Dec 2010 16:54:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 10 Dec 2010 16:54:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1886545
Xref: news.mathworks.com comp.soft-sys.matlab:694295

"Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <idtib5$aj4$1@fred.mathworks.com>...
> 
> > C = bsxfun(@(x,y)x(:,y(1:size(x,1):end)),A,B);
> 
> Don't even need bsxfun, they're the same size!
> 
> A(:,B(1:size(A,1):end))

It works iff B's row don't change.

Oleg