Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to get multiprod working
Date: Mon, 31 Jan 2011 19:17:04 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 18
Message-ID: <ii71rg$irk$1@fred.mathworks.com>
References: <ihal0c$l8n$1@fred.mathworks.com> <iham08$pjm$1@fred.mathworks.com> <ihbppt$nl1$1@fred.mathworks.com> <ihc5pk$o8u$1@fred.mathworks.com> <ihddhg$hhd$1@fred.mathworks.com> <ihdng9$jbp$1@fred.mathworks.com> <ihesh7$l8f$1@fred.mathworks.com> <ihfsbb$i9u$1@fred.mathworks.com> <ii6886$6mi$1@fred.mathworks.com> <ii6b24$6mn$1@fred.mathworks.com> <ii70ns$67o$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1296501424 19316 172.30.248.47 (31 Jan 2011 19:17:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 31 Jan 2011 19:17:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:707256

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <ii70ns$67o$1@fred.mathworks.com>...
> If your Matlab version cannot support BSXFUN, you can also do the old way with REPMAT:
> 
> dup = size(apply250_km2);
> dup([1 2 5]) = 1;
> M =  apply250_km2 .* repmat(lnox_mass_frac, dup);

Oops, there is a mistake 

sz= size(apply250_km2);
dup = sz;
sz([3 4]) = 1;
dup([1 2 5]) = 1;
M =  apply250_km2 .* repmat(reshape(lnox_mass_frac, sz), dup);

Hope it's alright (I program blindly).

Bruno