Je ne comprends rien à al fonctions de ces deux fonctions, dans un dossier @Tree j'ai:

subsasgn.m
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
function [T] = subsasgn(T,S,B)
% SUBSREF Subscript definition for Tree object
%
%		T(n,l) = vexp assigns the vector of expansion coefficients vexp
%		to box n at level l
%
 
	n = S.subs{1} + 1; % shift to account for 1-base indexing
	l = S.subs{2};
	T.level(l).box(n).vexp = B;
subsref.m
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
function [b] = subsref(T,S)
% SUBSREF Subscript definition for Tree object
%
%		b = T(n,l,tag) returns the value of 'tag' for box n at 
%		level l, where permissible values of 'tag' are:
%
%			'parent'    => Parent box index
%			'children'  => Set of children box indicies
%			'neighbors' => Set of neighbor box indicies
%			'E4'        => Set of E4(n,l) box indicies
%			'center'    => Coordinates of expansion center
%			'coef'      => Vector of expansion coefficients
 
	n = S.subs{1} + 1; % shift to account for 1-base indexing
	l = S.subs{2};
	switch S.subs{3}
		case 'parent'
			b = T.level(l).box(n).parent;
		case 'children'
			b = T.level(l).box(n).ch;
		case 'neighbors'
			b = T.level(l).box(n).ne;
		case 'E4'
			b = T.level(l).box(n).ne4;
		case 'center'
			b = T.level(l).box(n).xc;
		case 'coef'
			b = T.level(l).box(n).vexp;
		case 'indexset'
			i = 0;
			b = [];
			for j = T.jF(n):T.jL(n)
				i = i + 1;
				b(i) = T.ij(j);
			end
		otherwise
			error('Undefined subscripts')
	end
et

Tree.m
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
function [T] = Tree(varargin)
% TREE Tree class constructor
%
% T = Tree(Lmax, d) creates a single 2^d tree with Lmax levels.
%
% T = Tree(tag, var, d, Xset) creates a single 2^d tree with 
% source/target points given in Xset automatically parsed with 
% respect to each box and level to build non-empty child, neighbor 
% and E4 sets. If tag = 'Lmax', var is interpreted to be the maximum
% level in the tree; if tag = 's', then var is taken as the grouping
% parameter and used to determine Lmax.
 
	% Check if initializing with another Tree object...
	if (isa(varargin{1}, 'Box'))
		T = varargin{1};
		return
	end
 
	% Set up tree structure...
 
 
	T = struct('level', [], ...
			   'ij',    [], ...
			   'jF',    [], ...
			   'jL',    []);
 
	switch nargin
 
		case 2
 
			Lmax = varargin{1};
			d = varargin{2};
 
			for l = 1:Lmax
 
				nboxes = 2^(d*l);
 
				for n = 1:nboxes
					T.level(l).box(n) = initBox(n-1,l,d);
				end
 
			end 
 
		case 4
 
			% Interleave and sort points...
 
			tag  = varargin{1};
			var  = varargin{2};
			d    = varargin{3};
			Xset = varargin{4};
 
 
			Lavail = floor(30/d);
			N = size(Xset,1);
			Xi = zeros(1,N);
 
			for i=1:N
				Xi(i) = boxIndex(Xset(i,:), Lavail);
			end
 
			[Xi,T.ij] = sort(Xi);
 
			switch tag
				case 'Lmax'
					Lmax = var;
				case 's'
					Lmax = maxLevel(var,Xi,Lavail,d);
				otherwise
					error('Incorrect tag value');
			end
 
			if Lmax > Lavail
				warning('Lmax exceeds Lavail - setting Lmax = Lavail')
				Lmax = Lavail;
			end
 
			% Construct levels...
 
			for l = 1:Lmax
 
				nboxes = 2^(d*l);
 
				for n = 1:nboxes
					T.level(l).box(n) = initBox(n-1,l,d,Xi,Lavail);
				end
 
			end
 
			% Initialize 'bookmark' arrays ...
 
			% NOTE: 'bookmarks' are only set for Lmax - this is
			% because non-adaptive MLFMM only accesses source
			% and reciever points during initial S-expansion
			% and evaluation of R-expansion at Lmax.
 
			% 'shift' Xi to Lmax level for parsing with respect 
			% to boxes at Lmax.
			Xi = bitshift(Xi,d*(Lmax-Lavail));
 
			nboxes = 2^(d*Lmax);
			T.jF = ones(1,nboxes);
			T.jL = zeros(1,nboxes);
 
			imax = size(Xi,2);
			i = 1;
			while(i < imax + 1)
				n = Xi(i);
				T.jF(n+1) = i;
				while( n == Xi(i) )
					T.jL(n+1) = i;
					i = i + 1;
					if(i > imax) 
						break
					end
				end
			end
 
			% Clean up memory...
			Xi = [];
 
		otherwise
 
			error('Wrong number of inputs received')
 
	end
 
	% Construct Tree class...
	T = class(T, 'Tree');
Bon j'ai compris :
Tree.m est en fait le constructeur de la classe tree. Toutes les fonctions dans @Tree ont accès aux membres de la classe Tree.
Mais les deux fonctions subsref et subsasgn sont très obscur pour moi: je n'y comprends rien!! Svp je sais que ce n'est pas très courtois mais j'aurais besoin d'un petit coup de main rapide (car je suis un peu short en délai, vu la masse de boulot que je me tape...)