[Scilab-users] Generating a boolean vector or matrix

Federico Miyara fmiyara at fceia.unr.edu.ar
Wed Sep 4 09:11:27 CEST 2019


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.

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)?

Thank you.

Federico Miyara


---
El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20190904/15915bcc/attachment.htm>


More information about the users mailing list