From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: subtract vector from matrix rows without for loop
Date: Sun, 29 Nov 2009 04:54:03 +0000 (UTC)
Organization: Xoran Technologies
Lines: 7
Message-ID: <hesupb$i07$>
References: <hesm3s$3sn$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1259470443 18439 (29 Nov 2009 04:54:03 GMT)
NNTP-Posting-Date: Sun, 29 Nov 2009 04:54:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: comp.soft-sys.matlab:588601

"Patrick Diviacco" <> wrote in message <hesm3s$3sn$>...
> hi,
> can I subtract the same vector to each row of a matrix without using a for loop ?
> thanks

For loops may be optimal (looping along the smallest dimension of the matrix), when the smallest dimension is small enough.