Added source Matlab code for reference
This commit is contained in:
parent
b8af977117
commit
b5d99903d2
186 changed files with 61405 additions and 1 deletions
18
matlab/parallel/proportion2str.m
Normal file
18
matlab/parallel/proportion2str.m
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
function str = proportion2str(prob)
|
||||
%prob belongs to [0.00, 0.01, ... ,1].
|
||||
%str is a 4-mark presentation of proportion.
|
||||
|
||||
if abs(prob)<1e-3
|
||||
str = '0.00';
|
||||
elseif abs(prob-1) < 1e-3;
|
||||
str = '1.00';
|
||||
else
|
||||
prob = round(100*prob);
|
||||
if prob<10
|
||||
str = ['0.0' num2str(prob)];
|
||||
else
|
||||
str = ['0.' num2str(prob)];
|
||||
end;
|
||||
end;
|
||||
|
||||
%-------------------------------------------------------
|
||||
Loading…
Add table
Add a link
Reference in a new issue