?? randnt.c
字號:
/*
Truncated Gaussian numbers generator
Usage
-----
y = randnt(m , sigma , [left] , [right] , [n1] , ... , [np]);
Inputs
------
m Mean values (v1 x v2 x ...x vl) or scalar if randnt if called with more than 4 arguments
sigma Variance values (v1 x v2 x ...x vl) or scalar if randnt if called with more than 4 arguments
left Left boundaries (v1 x v2 x ...x vl) or scalar if randnt if called with more than 4 arguments
Right Right boundaries (v1 x v2 x ...x vl) or scalar if randnt if called with more than 4 arguments
ni Size of dimension i
Outputs
------
y Truncated independant samples (v1 x v2 x ... x vl) or (n1 x n2 x .... x np)
Examples
-------
y = randnt(0 , 1 , 0 , 3 , 2 , 3);
y = randnt(0 , 1 , [] , 3 , 2 , 3 , 2);
y = randnt(0 , 1 , [] , [] , 2 , 3 , 2); % <=> randn(2 , 3 , 2)
y = randnt(ones(2,2,3) , ones(2,2,3) , zeros(2,2,3) , ones(2,2,3));
y = randnt(ones(2,2) , ones(2,2)); N(1 , 1)*I_{2,2}
To compile :
------------
mex -DranSHR3 -output randnt.dll randnt.c or mex -DranKISS -output randnt.dll randnt.c (little bit slower)
Myself, I use Intel CPP compiler as :
mex -DranSHR3 -f mexopts_intel10AMD.bat -output randnt.dll randnt.c
Ver 1.0 (03/04/05)
Author : S閎astien PARIS
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -