[Scilab-users] Generating a boolean vector or matrix

Stéphane Mottelet stephane.mottelet at utc.fr
Thu Sep 5 13:02:22 CEST 2019


Le 05/09/2019 à 12:44, Antoine Monmayrant a écrit :
>
>
> Le 05/09/2019 à 11:28, Lamy Alain a écrit :
>>
>> What I didn’t like at first is to use “ones” for a boolean type.
>>
> That was also my first reaction.
> When comparing the learning curve and overall ease of use of scilab 
> with other options (matlab, julia, python), I always come to the 
> conclusion that the biggest problem with scilab is the use of 
> non-intuitive function names.

Concerning "ones" for initializing booleans, Matlab also allows the 
unintuitive ones(n,m,'logical'), but also has true(n,m) and false(n,m). 
The two latter could be easily added as macros

function out = true(varargin)
     out = ones(varargin(:),"boolean")
end

function out = false(varargin)
     out = zeros(varargin(:),"boolean")
end

once the patch has been merged

> For example 'horner' for polynom evaluation as compared to 'polyval' 
> is far from obvious unless you are already quite versed in polynom theory.
> If you couple non-intuitive function names (at least for 
> non-specialist and casual users) with a documentation that is far from 
> perfect, this scares a lot of possible users.
>
> Antoine
>>
>> (although I know the 2 types are almost interchangeable in Scilab).
>>
>> The existing function bool2s changes %t into 1.
>>
>> So thinking about it a little more, OK for the proposed extensions of 
>> “ones” and “zeros”.
>>
>> Alain
>>
>>
>> _______________________________________________
>> users mailing list
>> users at lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users

-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20190905/6a4dbe07/attachment.htm>


More information about the users mailing list