source:
proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/missing-data/manyrands.m
@
37
Last change on this file since 37 was 37, checked in by , 14 years ago | |
---|---|
File size: 364 bytes |
Line | |
---|---|
1 | function y = manyrands(m,k) |
2 | % Given a matrix, take all k-tuples of the columns. Then for each row, |
3 | % take the min value. Then take the average of all these. |
4 | tot = 0.0; |
5 | n = 0; |
6 | for tup = (all_ntuples(k,size(m,2)))' |
7 | m1 = m(:,tup'); |
8 | if k == 1 |
9 | tot = tot + sum(m1); |
10 | else |
11 | tot = tot + sum(min(m1')); |
12 | end |
13 | n = n + size(m,1); |
14 | end |
15 | y = tot/n; |
Note: See TracBrowser
for help on using the repository browser.