
Re: Generate random numbers with fixed sum and different constraints
Posted:
Nov 20, 2012 3:16 AM


"Roger Stafford" wrote in message <k8ee8q$k6f$1@newscl01ah.mathworks.com>... > R = bsxfun(@power,rand(m1,n),1./(m1:1:1)'); > X = cumprod([ones(1,n);R]).*[ones(m,n)[R;zeros(1,n)]];
Very neat! (Though I have no idea how it works).

