Matt J
Posts:
4,997
Registered:
11/28/09


Re: subtract vector from matrix rows without for loop
Posted:
Nov 28, 2009 11:54 PM


"Patrick Diviacco" <patrick.diviacco@gmail.com> wrote in message <hesm3s$3sn$1@fred.mathworks.com>... > 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.

