vector - Generating decimal values in matlab -
this question has answer here:
- random numbers add 100: matlab 4 answers
how generate vector of lets 5 decimal values such sum 10.
for i=1:5 d(i)=rand; end
1)i know generates vector, how include condition? 2) can generate negative numbers well?
d = rand(5,1); d = d * 10 / sum(d);
Comments
Post a Comment