root/applications/dual/SIDP/bakalarka/SIDPS/matlab/motor2/index.asv
@
1351
Revision 1351, 150 bytes (checked in by zimamiro, 13 years ago) |
---|
Rev | Line | |
---|---|---|
[1351] | 1 | function index=index(k,n_grid,dim) |
2 | index=zeros(1,dim); | |
3 | for i=dim:-1:1 | |
4 | index(i)=floor(k/n_grid^i); | |
5 | k=k-index(i)*n_grid^i; | |
6 | end | |
7 | index= | |
8 | end |
Note: See TracBrowser
for help on using the browser.