File: mlist.man

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (60 lines) | stat: -rw-r--r-- 1,643 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
.TH mlist 1 "September 1995" "Scilab Group" "Scilab Function"
.so ../sci.an
.SH NAME
mlist - Scilab object, matrix oriented typed list definition.
.SH CALLING SEQUENCE
.nf
mlist(typ,a1,....an )  
.fi
.SH PARAMETERS
.TP 10
typ
: vector of character strings
.TP 
ai
: any Scilab object (\fVmatrix, list,string...\fR).
.SH DESCRIPTION
mlist object are very similar to tlist objects. But if \fVM\fR is an
mlist, for any index \fVi\fR which is not a field name, \fVM(i)\fR is
not the \fVi\fRth field of the list but is interpreted as the \fVi\fR
th entry of \fVM\fR seen as a vector. This is the only difference
between  \fVmlist\fR and  \fVtlist\fR.
.LP

mlist fields must then be designed by their names. They can also be
handled using the \fVgetfield\fR  and \fVsetfield\fR  functions.

.SH EXAMPLE
.nf
M=mlist(['V','name','value'],['a','b','c'],[1 2 3]);
//define display
deff('%V_p(M)','disp(M.name+'':''+string(M.value))')
//define extraction operation
deff('r=%V_e(i,M)',..
'r=mlist([''V'',''name'',''value''],M.name(i),M.value(i))')
M(2) // the second entry of the vector M
M(2).value 

//define M as a tlist
M=tlist(['V','name','value'],['a','b','c'],[1 2 3]);
M(2)

M('name')

//with two  indices
M=mlist(['V','name','value'],['a','b';'c' 'd'],[1 2;3 4]);
deff('r=%V_e(varargin)',[
    'M=varargin($)';
    'H=[''V'',''name'',''value'']'
    'r=mlist(H,M.name(varargin(1:$-1)),M.value(varargin(1:$-1)))'])

M(:,2)
// multidimensionnal array
str=['a','b','c','d','e','f','g','h'];
n=hypermat([2,2,2],str);
v=hypermat([2,2,2],1:8);
M=mlist(['V','name','value'],n,v);
M(1,1:2,2)
.fi
.SH SEE ALSO
tlist, list, overloading, getfield, setfield