0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 function [t,y,x] = do_a_run_mat(Nruns, Nsamples, Nstates, Nstatesout, Ninputs, Noutputs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 lastX = zeros(Nstates,1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 A = 0.1*rand(Nstates);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 Coutputs = rand(Noutputs,Nstates);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 Cstates = eye(Nstates);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 Cstates = Cstates(1:Nstatesout,1:Nstates);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 Baos = rand(Nstates,Ninputs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 Daos = rand(Noutputs, Ninputs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 input = randn(Ninputs, Nsamples);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 tic
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 for rr=1:Nruns
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 [y,x,lx] = mat_ssmsim(lastX, A, Coutputs, Cstates, Baos, Daos, input);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 mxtime = toc;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 t = mxtime/Nruns;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 end
|