[Scilab-users] Question about the infamous dot

Sylvestre Ledru sylvestre.ledru at scilab-enterprises.com
Sat Oct 20 06:12:05 CEST 2012


FYI, Scilab 5.4.1 will show:

-->1./[2 3 4]
Warning: "1./ ..." is interpreted as "1.0/ ...". Use "1 ./ ..." for
element wise operation
 ans  =

    0.0689655
    0.1034483
    0.1379310

Sylvestre


On 19/10/2012 16:56, Adrien Vogt-Schilb wrote:
> hI
> 
> This is interpreted as 1.0/[2 3 4]  (yes it is combersome)
> 
> you want to use:
> 
> 1.0./[2 3 4]
> 
> or
> 
> 1 ./[2 3 4]   //mind the space before the dot
> 
> you can also use [2 3 4].^-1
> 
> 
> note that
> 
> [2 3 4]*[0.0689;0.1034;0.1379] = 1
> 
> also note the orientation of each matrix (row or column)
> 
> 
> On 19/10/2012 08:14, Melvyn Drag wrote:
>> In one of the exercises that came with the scilab documentation there
>> is a question that says:
>> Why does:
>> 1./[2 3 4]
>> give the strange result
>> 0.0689
>> 0.1034
>> 0.1379
>>
>> Instead of
>>
>> 0.5
>> 0.333
>> 0.25
>>
>> I can't seem to come up with an answer.
>>
>> Thanks for the help!
>>
>> Mel
>>
>>
>> _______________________________________________
>> users mailing list
>> users at lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
> 
> 
> 
> 
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users


-- 
Sylvestre Ledru
Operations Manager / Community Manager
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
http://www.scilab-enterprises.com




More information about the users mailing list