[Scilab-users] Logical zero

2016-02-01 Thread shamikam
Is there a Scilab equivalent for the false function in Matlab? I want to
create a matrix of logical zeros. Is there any other way to do it.

Shamika






--
View this message in context: 
http://mailinglists.scilab.org/Logical-zero-tp4033361.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Logical zero

2016-02-01 Thread Stéphane Mottelet

Le 01/02/2016 09:10, shamikam a écrit :

Is there a Scilab equivalent for the false function in Matlab? I want to
create a matrix of logical zeros. Is there any other way to do it.

Shamika






--
View this message in context: 
http://mailinglists.scilab.org/Logical-zero-tp4033361.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Many ways, such as

~ones(n,m), zeros(n,m)>0, ...

S.

--
Département de Génie Informatique
EA 4297 Transformations Intégrées de la Matière Renouvelable
Université de Technologie de Compiègne -  CS 60319
60203 Compiègne cedex

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Logical zero

2016-02-01 Thread Serge Steer

Le 01/02/2016 10:16, Tim Wescott a écrit :
I believe that a = zeros(n, m) == 1 will do it, but it may not be 
either the best or the official way.



An other  solution is %f(ones(n,m))
Serge



Sent from my Verizon Wireless 4G LTE smartphone


 Original message 
From: shamikam 
Date: 02/01/2016 12:10 AM (GMT-08:00)
To: users@lists.scilab.org
Subject: [Scilab-users] Logical zero

Is there a Scilab equivalent for the false function in Matlab? I want to
create a matrix of logical zeros. Is there any other way to do it.

Shamika






--
View this message in context: 
http://mailinglists.scilab.org/Logical-zero-tp4033361.html
Sent from the Scilab users - Mailing Lists Archives mailing list 
archive at Nabble.com.

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Logical zero

2016-02-01 Thread Tim Wescott


I believe that a = zeros(n, m) == 1 will do it, but it may not be either the 
best or the official way. 


Sent from my Verizon Wireless 4G LTE smartphone

 Original message 
From: shamikam  
Date: 02/01/2016  12:10 AM  (GMT-08:00) 
To: users@lists.scilab.org 
Subject: [Scilab-users] Logical zero 

Is there a Scilab equivalent for the false function in Matlab? I want to
create a matrix of logical zeros. Is there any other way to do it.

Shamika






--
View this message in context: 
http://mailinglists.scilab.org/Logical-zero-tp4033361.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Logical zero

2016-02-01 Thread Stéphane Mottelet

BTY, I am worried about the Scilab 6.0 timing (3.3228213 seconds)  of

a(1:n,1:m)=%f;

i.e. more than ten times slower than Scilab 5.5.1 (0.2964019 seconds).

Does somebody have an explanation ?

S.


Le 01/02/2016 14:40, Jan-Åge Langeland a écrit :
I ran a little speed test with the different alternatives, I found the 
results surprising:


Jan

//script ftest.sce m=1 n=1 v=ver(); disp(v(1,1:2)); clear a; 
timer(); a = zeros(n, m) == 1; //best in Scilab 6.0.0 disp(timer()); 
clear a; timer(); a=zeros(n,m)>0; disp(timer()); clear a; timer(); 
a=%f(ones(n,m)); disp(timer()); clear a; timer(); 
*a**(**1**:**n**,**1**:**m**)**=**%f**;* //best in Scilab 5.5.1 
disp(timer()); clear a; //end script ftest.sce -->exec('ftest.sce',-1) 
!Scilab Version: 5.5.1.1412169962 ! 1.482009500037543941 
1.37280880029805233 0.530403399546722393 
0.296401899780135113 -->exec('ftest.sce',-1) !Scilab Version: 
6.0.0.1447231131 ! 0.6708043 1.3260085 2.7300175 3.3228213



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



--
Département de Génie Informatique
EA 4297 Transformations Intégrées de la Matière Renouvelable
Université de Technologie de Compiègne -  CS 60319
60203 Compiègne cedex

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Logical zero

2016-02-01 Thread Jan-Åge Langeland
I ran a little speed test with the different alternatives, I found the 
results surprising:


Jan

//script ftest.sce m=1 n=1 v=ver(); disp(v(1,1:2)); clear a; 
timer(); a = zeros(n, m) == 1; //best in Scilab 6.0.0 disp(timer()); 
clear a; timer(); a=zeros(n,m)>0; disp(timer()); clear a; timer(); 
a=%f(ones(n,m)); disp(timer()); clear a; timer(); a(1:n,1:m)=%f; //best 
in Scilab 5.5.1 disp(timer()); clear a; //end script ftest.sce 
-->exec('ftest.sce',-1) !Scilab Version: 5.5.1.1412169962 ! 
1.482009500037543941 1.37280880029805233 
0.530403399546722393 0.296401899780135113 
-->exec('ftest.sce',-1) !Scilab Version: 6.0.0.1447231131 ! 0.6708043 
1.3260085 2.7300175 3.3228213


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Logical zero

2016-02-01 Thread Dang Ngoc Chan, Christophe
Hello,

> De : Jan-Åge Langeland
> Envoyé : lundi 1 février 2016 14:41
>
> I ran a little speed test with the different alternatives, I found the 
> results surprising:

These kind of tests are of course interesting, but I'm always suspicious 
because of the buffering.

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Logical zero

2016-02-01 Thread Jan-Åge Langeland
I forgot to test  a=~ones(n,m). I guess this is the overall winner (from 
Stéphane Mottelet):


Scilab 5.5.1: 0.2964019
Scilab 6.0.0: 0.5616036

Jan
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Logical zero

2016-02-01 Thread Serge Steer
find below the results on my computer (Linux) for Scilab-5.5.2 and last 
nightly build



Version de Scilab : 6.0.0.1454090908   
Version de Scilab :   5.5.2.1427793548


zeros(n, m) == 1 11.788 
 1.416

zeros(n,m)>0 8.47   
  1.043

%f(ones(n,m))   9.347   
1.164

 a(1:n,1:m)=%f 4.352 0.816

*The scilab6 times are quite high!*

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users