Path: news.mathworks.com!not-for-mail
From: "Sean de " <sean.dewolski@nospamplease.umit.maine.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Creating a matrix from information in two other matrixes
Date: Fri, 10 Dec 2010 15:52:05 +0000 (UTC)
Organization: University of Maine
Lines: 6
Message-ID: <idtib5$aj4$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>
Reply-To: "Sean de " <sean.dewolski@nospamplease.umit.maine.edu>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1291996325 10852 172.30.248.38 (10 Dec 2010 15:52:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 10 Dec 2010 15:52:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2256903
Xref: news.mathworks.com comp.soft-sys.matlab:694279


> 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))