fast binomial random numbers
5 次查看(过去 30 天)
显示 更早的评论
I hate to ask this, because I'm asking someone to do my work for me. Could someone help me write a fast binomial random number generator?
I have written this:
function X = binom(N,p)
X = sum(rand(1,N)<p);
end
which is about 3x faster than the built-in vectorized version.
I would like to write a compiled c version, but I basically know nothing about c.
Thanks
0 个评论
回答(2 个)
Paulo Silva
2011-8-3
Try using the GUI from
deploytool
if you have it installed.
or just
mcc -m binom.m
5 个评论
Walter Roberson
2011-8-3
If you cannot get MATLAB to see lcc win32, then you may be using the 64 bit version of MATLAB. See here for the 2011a Windows 64 list. Please note that there are two pieces of software to install for Windows 64: be sure to read the notes!
3 个评论
Walter Roberson
2011-8-3
I did say to read the notes. The link I posted tells you specifically what else you have to install. See in particular notes #1 and #3.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Troubleshooting in MATLAB Compiler SDK 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!