Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: vectorizing matrix multiplication
Date: Thu, 16 Jun 2011 12:56:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <itcuh5$jfa$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1308228965 19946 172.30.248.48 (16 Jun 2011 12:56:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 16 Jun 2011 12:56:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2908307
Xref: news.mathworks.com comp.soft-sys.matlab:732196

I am trying to vectorize some matrix multiplication.

How would I vectorize this,

a = rand(10,2);
b = rand(10,6);

for i1 = 1:size(a,2)
    for i2 = 1:size(b,2)
        c{i1,i2} = a(:,i1).*b(:,i2);
    end
end

Thanks,

Nate