source:
proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/missing-data/prob_round.m
@
37
Last change on this file since 37 was 37, checked in by , 14 years ago | |
---|---|
File size: 160 bytes |
Line | |
---|---|
1 | function y = prob_round(x) |
2 | % probabilistically round a numer. ie, for x between 0 and 1, |
3 | % x is rounded up with prob. x. |
4 | f = floor(x); |
5 | y = f + ((x-f) > rand); |
Note: See TracBrowser
for help on using the repository browser.