help-octave
[Top][All Lists]
Advanced

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

Re: Bug: Re: [a (b + c)] == [a b+c] ?


From: Paul Kienzle
Subject: Re: Bug: Re: [a (b + c)] == [a b+c] ?
Date: Sat, 17 Jun 2000 14:43:15 +0100 (BST)

This is in the octave help files:

     If the value of `whitespace_in_literal_matrix' is `"traditional"',
     Octave will convert spaces to a comma between identifiers and `('.
     For example, given the matrix

          m = [3 2]

     the expression

          [m (1)]

     will be parsed as

          [m, (1)]

     and will result in

          [3 2 1]

Paul Kienzle
address@hidden

From: Joao Cardoso <address@hidden>
>I think that this is definitively a parser bug (probably difficult to
>correct)
>(it also occurs in 2.1.30):
>
>
>octave:1> T=(1:5)';
>
>octave:2> [T T]
>ans =
>
>  1  1
>  2  2
>  3  3
>  4  4
>  5  5
>
>octave:3> [T (T)]
>ans =
>
>  1
>  2
>  3
>  4
>  5
>
>octave:4> [T (1+T)]
>error: invalid vector index = 6
>
>octave:5> [T, (1+T)]
>ans =
>
>  1  2
>  2  3
>  3  4
>  4  5
>  5  6
>
>
>Joao
>
>Daniel Kottow wrote:
>> 
>> i am trying to get a matlab implementation to work on octave (GTM
>> toolbox) and the following gave me some trouble:
>> 
>> lets define:
>> 
>> T = [0.15:0.05:3.05]';
>> 
>> then evaluate:
>> 
>> [T (T + 1.25*sin(2*T))]
>> 
>> and compare to
>> 
>> [T T+1.25*sin(2*T)]
>> 
>> which does give you the 2 col matrix [T f(T)] as intended.
>> 
>> (from the GTM source you may guess that matlab does the second thing on
>> both commands)
>> btw, i am only posting this as an "octave-tester". no suggestion
>> implied.
>> 
>> -----------------------------------------------------------------------
>> Octave is freely available under the terms of the GNU GPL.
>> 
>> Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
>> How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
>> Subscription information:  http://www.che.wisc.edu/octave/archive.html
>> -----------------------------------------------------------------------
>
>
>
>-----------------------------------------------------------------------
>Octave is freely available under the terms of the GNU GPL.
>
>Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
>How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
>Subscription information:  http://www.che.wisc.edu/octave/archive.html
>-----------------------------------------------------------------------
>
>
>



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

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



reply via email to

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