|
Cool, thanks Bobby!
David
"Bobby Cheng" <bcheng@mathworks.com> wrote in message <hn6v5d$dg1$1@fred.mathworks.com>...
> bsxfun(@rdivide, [1 2 3; 4 5 6],[2 4 5])
>
> "a " <davidsojka@gmail.com> wrote in message
> news:hn6tqk$iq8$1@fred.mathworks.com...
> >I have a matrix MxN and want each element in a column to divide by the same
> >scalar. It means if I have N columns, I have N scalars forming a vector
> >with N numbers.
> >
> > Example:
> >
> > Matrix 123
> > 456
> >
> > divided by (2,4,5}
> >
> > what I want to get is a new matrix with these elements:
> > 1/2 2/4 3/5
> > 4/2 5/4 6/5
> >
> > Any help is appreciated.
> >
>
|