Random angle in matlab -
i'm trying write matlab program able random walk, each step/vector has same length , thing determines direction "random" angle. angle not quite random since has specific boundary conditions. i'm new matlab, if have tips or links webpages feel free post them here.
use function rand(1)
generate observation of uniform random variable drawn range [0,1]
. can convert variable range of angles. code below might trick.
randval = rand(1); % generate observation of random variable randangle = randval*(maxangle-minangle) + minangle; % map observation angle
Comments
Post a Comment