Matt J
Posts:
4,979
Registered:
11/28/09
|
|
Re: Temporary output when assigning into slices?
Posted:
Jan 23, 2013 7:02 PM
|
|
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kdprb0$ka6$1@newscl01ah.mathworks.com>... > "Matt J" wrote in message <kdpkhg$p22$1@newscl01ah.mathworks.com>... > > > > > If so, why doesn't this apply to both examples? The LHS is the same in these examples. > > Not sure I understand, A(1,:) = ... is not the same as A(:,1) = ....
OK. Well then a 3rd example
A(:,1)=B*C(:,1);
If I'm not mistaken, this will be equivalent to
z=C(:,1); %memory allocation
A(:,1)=B*z;
All subsref operations, AFAIK, result in freshly allocated memory, even though it's not necessary here.
|
|