1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
4
<LANGUAGE>eng</LANGUAGE>
6
<TYPE>Scilab Function</TYPE>
7
<DATE>September 1995</DATE>
8
<SHORT_DESCRIPTION name="mlist"> Scilab object, matrix oriented typed list definition. </SHORT_DESCRIPTION>
10
<CALLING_SEQUENCE_ITEM>mlist(typ,a1,....an ) </CALLING_SEQUENCE_ITEM>
15
<PARAM_NAME>typ</PARAM_NAME>
17
<SP>: vector of character strings</SP>
21
<PARAM_NAME>ai</PARAM_NAME>
23
<SP>: any Scilab object (<VERB>matrix, list,string...</VERB>).</SP>
30
mlist object are very similar to tlist objects. But if <VERB>M</VERB> is an
31
mlist, for any index <VERB>i</VERB> which is not a field name, <VERB>M(i)</VERB> is
32
not the <VERB>i</VERB>th field of the list but is interpreted as the <VERB>i</VERB>
33
th entry of <VERB>M</VERB> seen as a vector. This is the only difference
34
between <VERB>mlist</VERB> and <VERB>tlist</VERB>.</P>
36
mlist fields must then be designed by their names. They can also be
37
handled using the <VERB>getfield</VERB> and <VERB>setfield</VERB> functions.</P>
41
M=mlist(['V','name','value'],['a','b','c'],[1 2 3]);
43
deff('%V_p(M)','disp(M.name+'':''+string(M.value))')
44
//define extraction operation
46
'r=mlist([''V'',''name'',''value''],M.name(i),M.value(i))')
47
M(2) // the second entry of the vector M
51
M=tlist(['V','name','value'],['a','b','c'],[1 2 3]);
57
M=mlist(['V','name','value'],['a','b';'c' 'd'],[1 2;3 4]);
58
deff('r=%V_e(varargin)',[
60
'H=[''V'',''name'',''value'']'
61
'r=mlist(H,M.name(varargin(1:$-1)),M.value(varargin(1:$-1)))'])
64
// multidimensionnal array
65
str=['a','b','c','d','e','f','g','h'];
66
n=hypermat([2,2,2],str);
67
v=hypermat([2,2,2],1:8);
68
M=mlist(['V','name','value'],n,v);
80
<LINK>overloading</LINK>