rand_props2.m

Revision 1 - 8/1/07 at 7:04 am by brice.semmens

Next rev
Back to revision history for rand_props2.m
This file is part of the project MixSIR
function [prop_vec] = rand_props(num_prey)

rand_nums=sort(rand(num_prey-1,1)); %sets up vec for sorting
prop_vec=zeros(num_prey,1);
prop_vec(1,1)=rand_nums(1,1);

for j=2:num_prey-1
   prop_vec(j,1)=rand_nums(j,1)-rand_nums(j-1,1);
end
prop_vec(num_prey,1)=1-sum(prop_vec);

   


Sculpin 0.2 | xhtml | problems or comments? | report bugs