[Scilab-users] Associative Array Keys

Samuel Gougeon sgougeon at free.fr
Fri Sep 18 20:20:06 CEST 2015


Le 18/09/2015 20:10, kootsoop a écrit :
> I am thinking of associative arrays in Scilab:
.
It is called a /structure/, and keys are fields.
aa("key1") = %pi
aa("boo") = %t
aa("pol") = (1-%s)^3
aa("txt") = "Hi"

> and was wondering whether it's possible to either enumerate all the keys
> ("test", "test2")
fieldnames(aa) // does it


> or check whether a key exists?
or(fieldnames(aa)=="thatKey") // does it

Regards
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20150918/07f0b5d8/attachment.htm>


More information about the users mailing list