help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: function applied to each component in an if clause


From: Olaf Till
Subject: Re: function applied to each component in an if clause
Date: Thu, 13 Mar 2008 15:50:12 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

On Wed, Mar 12, 2008 at 12:22:38PM -0400, John W. Eaton wrote:
> On 12-Mar-2008, Olaf Till wrote:
> ...
> | Octave and matlab print out the contents of the whole variable to
> | which is assigned (without ;), even if you assign only to some
> | components. mmh --- this seams really not intuitive since in octave
> | the assignment itself has a value, which comprises only the assigned
> | components; if you type
> | 
> | a = x(lower) = 4*x(lower)
> | 
> | only the assigned components will be displayed.
> 
> In this case, the variable A contains only the subset of elements, so
> only those are displayed.
> 
> In Matlab, assigment is not an expression, so this "problem" doesn't
> appear.  OTOH, you can't use assignment as an expression either.
> 
> Also, wouldn't it be equally confusing if an indexed assignment
> expression printed the subset of elements?

Yes, that's probably right. And there is indeed no real problem with
displaying the whole variable in this way. Olaf

> Or worse, if Octave
> printed the subset of elements but Matlab printed the whole array (I'm
> pretty sure we would hear some complaints about that...)?
> 
> jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]