Path: news.mathworks.com!newsfeed-00.mathworks.com!newscon02.news.prodigy.net!prodigy.net!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!news02.roc.ny.POSTED!33b9410e!not-for-mail
From: Doug Schwarz <see@sig.for.address.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Newbie: Subtract a vector from m-n-p array?
References: <fpet32$rj1$1@fred.mathworks.com> <fpev1t$4nf$1@canopus.cc.umanitoba.ca> <fpf14u$1a3$1@fred.mathworks.com> <see-CB6AA1.14071719022008@71-129-133-66.dollamir.com> <fpfo56$6tp$1@fred.mathworks.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
User-Agent: MT-NewsWatcher/3.5.2 (Intel Mac OS X)
Message-ID: <see-A60B73.19035519022008@71-129-133-66.dollamir.com>
Lines: 33
X-Complaints-To: abuse-news@frontiernet.net
X-Trace: 52616e646f6d4956446f3631ec51d5f4586cbed77f01b8f514a00a05e21ff1f71868cbfdeb627edb89866f83221048eced3f438fa18fe7d43996caff19c36e20af0ef5c0ddf9e678d5edb32cc8b42b5d3a8ccc92249a8c44cfb337b3af68ca666caa355cbb9ab19e532193990806c0e8441bf81b56654f331162237b79a84aaa
X-Abuse-Info: Please be sure to forward ALL headers so that we may process your complaint properly.
NNTP-Posting-Date: Wed, 20 Feb 2008 00:03:54 UTC
Date: Wed, 20 Feb 2008 00:03:54 GMT
Xref: news.mathworks.com comp.soft-sys.matlab:452536



In article <fpfo56$6tp$1@fred.mathworks.com>,
 "Volker K" <klinkv.NOSPAM@yahoo.de> wrote:

> Problem: I only have Matlab 7.2 :-(
> 
> I wonder that there's
>  no possibility in MatLab to do these kind of operations:
> > > M(:,:)-V(1)
> > > M(:,:)-V(2)
> > > M(:,:)-V(3)
> > > M(:,:)-V(4)
> > > ...
> > > M(:,:)-V(end) 
> 
> I guess it is a common problem...


All hope is not lost.  you can download my genop.m from the FEX and use 
it instead of bsxfun.  It will be slower, but it will work and no data 
will be copied.

<http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId
=10333&objectType=FILE>

(watch out for wrapped URL)


  genop(@minus,M,permute(V,[3 2 1]))

-- 
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.