Thanks Mathieu,<br><br>You confirm what I suspected. I would to build the function myself, using a code similar to yours but recursive... Not a big deal, though.<br><br>Sebastien<br><br><div class="gmail_quote">On Fri, Feb 12, 2010 at 3:21 AM, Mathieu Dubois <span dir="ltr"><<a href="mailto:mathieu.dubois@limsi.fr">mathieu.dubois@limsi.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello Sébastien,<br>
<br>
Thanks to Gianluca I gave a second look to your message.<br>
<br>
I think that mlist and function overloading fit your needs (see attachment and scilab's help).<br>
<br>
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,...<br>
<br>
HTH,<br><font color="#888888">
Mathieu</font><div><div></div><div class="h5"><br>
Sébastien Bihorel wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
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:<br>
<br>
> mylist<-list(a=list(abc=1:10,xyz=letters[1:15]),<br>
elem=matrix(1:10,ncol=2))<br>
> mylist<br>
$a<br>
$a$abc<br>
[1] 1 2 3 4 5 6 7 8 9 10<br>
<br>
$a$xyz<br>
[1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o"<br>
<br>
<br>
$elem<br>
[,1] [,2]<br>
[1,] 1 6<br>
[2,] 2 7<br>
[3,] 3 8<br>
[4,] 4 9<br>
[5,] 5 10<br>
<br>
> str(mylist)<br>
List of 2<br>
$ a :List of 2<br>
..$ abc: int [1:10] 1 2 3 4 5 6 7 8 9 10<br>
..$ xyz: chr [1:15] "a" "b" "c" "d" ...<br>
$ elem: int [1:5, 1:2] 1 2 3 4 5 6 7 8 9 10<br>
<br>
<br>
Thanks<br>
<br>
Sebastien<br>
</blockquote>
<br>
</div></div><br>// R syntax<br>
//mylist<-list(a=list(abc=1:10,xyz=letters[1:15]),<br>
// elem=matrix(1:10,ncol=2))<br>
<br>
clc;<br>
clear;<br>
<br>
mylist=mlist(['V', 'a', 'xyz', 'elem'], 1:10, 'a':'o', matrix(1:10, [5,2]));<br>
<br>
typeof(mylist)<br>
<br>
//define display<br>
function []=%V_p(M)<br>
disp('Hello I''m an overloaded function');<br>
disp('Field a is');<br>
disp(string(M.a));<br>
disp('Field xyz is');<br>
disp(string(M.xyz));<br>
disp('Field elem is')<br>
disp(string(M.elem));<br>
endfunction<br>
<br>
mylist<br>
<br></blockquote></div><br>