Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Temporary output when assigning into slices?
Date: Thu, 24 Jan 2013 00:02:08 +0000 (UTC)
Organization: Xoran Technologies
Lines: 19
Message-ID: <kdptm0$rtt$1@newscl01ah.mathworks.com>
References: <kdpbb4$gtp$1@newscl01ah.mathworks.com> <kdpg30$6gl$1@newscl01ah.mathworks.com> <kdpja4$jnk$1@newscl01ah.mathworks.com> <kdpk0k$mmi$1@newscl01ah.mathworks.com> <kdpkhg$p22$1@newscl01ah.mathworks.com> <kdprb0$ka6$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-06-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1358985728 28605 172.30.248.38 (24 Jan 2013 00:02:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 24 Jan 2013 00:02:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:787263

"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.