Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Using functions and structures sensibly
Date: Thu, 8 May 2008 16:13:14 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 17
Message-ID: <fvv8qq$1d8$1@canopus.cc.umanitoba.ca>
References: <fvuu3s$bd$1@fred.mathworks.com> <fvv6bf$4gd$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1210263194 1448 192.70.172.160 (8 May 2008 16:13:14 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Thu, 8 May 2008 16:13:14 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:467430



In article <fvv6bf$4gd$1@fred.mathworks.com>,
someone  <someone@somewhere.net> wrote:

>The only reason why I know modifying inputs "is bad" is 
>that MATLAB will pass the inputs by value (instead of by 
>reference).  But, one way or another, you are creating 
>another copy of myStruct anyway.

I -gather- (perhaps incorrectly) from other postings that the
special case of having the same variable on input and output
of a function is handled by modifying the variable in-place
rather than creating a copy of the variable (other than
if the variable happens to share data with another variable.)
-- 
  "Man's life is but a jest,
   A dream, a shadow, bubble, air, a vapor at the best."
                                         -- George Walter Thornbury