[scilab-Users] Looking for a function

Mathieu Dubois mathieu.dubois at limsi.fr
Fri Feb 12 09:21:28 CET 2010


Hello Sébastien,

Thanks to Gianluca I gave a second look to your message.

I think that mlist and function overloading fit your needs (see 
attachment and scilab's help).

Please note that I'm not an expert in scilab's mlist so this code comes 
"as is" with no express or implied warranty for accuracy or 
accessibility, blah, blah, blah,...

HTH,
Mathieu
Sébastien Bihorel wrote:
> Hello,
>
> I was wondering if there is a function in Scilab that allows to 
> display lists in a compact way rather than as a (sometime endless) 
> listing. I did not see any link to such function in 'help list'. For 
> those of you who are familiar in the R language, I am looking for 
> something like the 'str' function, as exemplified below:
>
> > mylist<-list(a=list(abc=1:10,xyz=letters[1:15]),
>                elem=matrix(1:10,ncol=2))
> > mylist
> $a
> $a$abc
>  [1]  1  2  3  4  5  6  7  8  9 10
>
> $a$xyz
>  [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o"
>
>
> $elem
>      [,1] [,2]
> [1,]    1    6
> [2,]    2    7
> [3,]    3    8
> [4,]    4    9
> [5,]    5   10
>
> > str(mylist)
> List of 2
>  $ a   :List of 2
>   ..$ abc: int [1:10] 1 2 3 4 5 6 7 8 9 10
>   ..$ xyz: chr [1:15] "a" "b" "c" "d" ...
>  $ elem: int [1:5, 1:2] 1 2 3 4 5 6 7 8 9 10
>
>
> Thanks
>
> Sebastien

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test_sebastien.sce
URL: <https://lists.scilab.org/pipermail/users/attachments/20100212/627e9ff8/attachment.ksh>


More information about the users mailing list