Skip to content

Commit

Permalink
tweak discreteRnd
Browse files Browse the repository at this point in the history
  • Loading branch information
sth4nth committed Sep 17, 2019
1 parent f20e50e commit 1501973
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions chapter11/discreteRnd.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@
if nargin == 1
n = 1;
end
r = rand(1,n);
p = cumsum(p(:));
[~,~,x] = histcounts(r,[0;p/p(end)]);
[~,~,x] = histcounts(rand(1,n),[0;cumsum(p(:))]);

0 comments on commit 1501973

Please sign in to comment.