samer@0
|
1 % mt_init - Initialise Melody Triangle system.
|
samer@0
|
2 %
|
samer@0
|
3 % mt_init ::
|
samer@0
|
4 % A0:nonneg ~'parameter for sampling',
|
samer@0
|
5 % B0:nonneg ~'parameter for sampling',
|
samer@0
|
6 % A1:nonneg ~'parameter for sampling',
|
samer@0
|
7 % B0:nonneg ~'parameter for sampling',
|
samer@0
|
8 % L:natural ~'number of transmats to sample'
|
samer@0
|
9 % -> mt_system.
|
samer@0
|
10 %
|
samer@0
|
11 % Initial system contains no transition matrices - you
|
samer@0
|
12 % must call mt_ensure with a particular value of K
|
samer@0
|
13 % to sample a set of L transition matrices of that size.
|
samer@0
|
14 %
|
samer@0
|
15 % Initial calibration is equivalent to:
|
samer@0
|
16 % sys=mt_calibrate(sys, 1:3, [0,1,0;0,0,1]);
|
samer@0
|
17 %
|
samer@0
|
18 % The figure for scatter plots is fixed to figure 50 for now.
|
samer@0
|
19
|
samer@0
|
20 function Sys=mt_init(A0,B0,A1,B1,L)
|
samer@0
|
21 Sys.sample_transmats = @(k)sample_transmat_hdp(A0,B0,A1,B1,k,L);
|
samer@0
|
22 Sys.transmats = {};
|
samer@0
|
23 Sys.info = {};
|
samer@0
|
24 Sys.refpoints = [0,0;1,0;0,1]';
|
samer@0
|
25 Sys.fig = 50;
|
samer@0
|
26 Sys = mt_calibrate(Sys);
|
samer@0
|
27 end
|