help-octave
[Top][All Lists]
Advanced

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

Re: sqrt(1:4)(1:2:4) -> 1.0000 1.4142 1.7321 2.0000


From: Henry F. Mollet
Subject: Re: sqrt(1:4)(1:2:4) -> 1.0000 1.4142 1.7321 2.0000
Date: Sun, 31 Oct 2004 09:01:37 -0800
User-agent: Microsoft-Entourage/10.1.1.2418

Older version of octave gave the same "bothering" result, whereas using
extra [] worked and was posted previously.
Henry
[~] tcsh:11> octave
GNU Octave, version 2.1.46 (powerpc-apple-darwin6.6).
octave:1> sqrt(1:4)(1:2:4)
ans =
  1.0000  1.4142  1.7321  2.0000
octave:2> [sqrt(1:4)](1:2:4)
ans =
  1.0000  1.7321


on 10/31/04 6:08 AM, Joseph C. Slater at address@hidden wrote:

> 
> On Oct 29, 2004, at 3:59 PM, Etienne Grossmann wrote:
> 
>> 
>>   Hi all,
>> 
>> I'm using 2.1.57. Is this the usual/desired behavior? I have the
>> feeling that it used to be that lines 17, 19 and 20 below would all
>> give the same result, that of line 20.
>> 
>>   Cheers,
>> 
>>   Etienne
>> 
>> octave:17> sqrt(1:4)(1:2:4)
>> ans =
>> 
>>   1.0000  1.4142  1.7321  2.0000
>> 
> 
> This result bothered me, so I tried it myself and got the following:
>>> sqrt(1:4)(1:2:4)
> ans =
> 
>  1.00000  1.73205
> 
> Same version of Octave.  Peculiar that you wouldn't get the same.
> Joe
> 
> 
> \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
> (+1) 937-775-5085
> http://www.cs.wright.edu/~jslater
> 
> 
> 
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
> 
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
> 



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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