Stéphane,
Questions:
1) Why does it work?
2) Is there some native function to create bolean matrices
3) If not, are there any plans to introduce functions such as
true(m,n) or false(m,n)?
Yes, there :
https://codereview.scilab.org/#/c/19964/
S.
with the following syntax:
Le 04/09/2019 à 09:39, Stéphane Mottelet a écrit :
Hello,
Le 04/09/2019 à 09:11, Federico Miyara a écrit :
Dear all,
I need to create a boolean vector, such as [%t, %t, %t, %t] but with
a number of components given by a variable n. I couldn't find a
function similar to ones(1,n).
Hello,
Le 04/09/2019 à 09:11, Federico Miyara a écrit :
Dear all,
I need to create a boolean vector, such as [%t, %t, %t, %t] but with a
number of components given by a variable n. I couldn't find a function
similar to ones(1,n).
However I've found a workaround:
a = ones(1,n) & %t
It
Hello,
> De : Federico Miyara
> Envoyé : mercredi 4 septembre 2019 09:11
>
> I need to create a boolean vector, such as [%t, %t, %t, %t] […] I
> couldn't find a function similar to ones(1,n).
>
> However I've found a workaround:
>
> a = ones(1,n) & %t
> […]
> 1) Why does it work?
Because "A
Dear all,
I need to create a boolean vector, such as [%t, %t, %t, %t] but with a
number of components given by a variable n. I couldn't find a function
similar to ones(1,n).
However I've found a workaround:
a = ones(1,n) & %t
It shouldn't work because ones(1,n) is not boolean, but it does.