random walk in matlab without the econometrics toolbox

4 次查看(过去 30 天)
Hi,
I am looking for a way to create a random walk in matlab without having the financial toolbox

采纳的回答

Shashank Prasanna
  6 个评论
Cedric
Cedric 2013-5-2
n = 200 ; m = 20 ;
figure ; hold on ;
for k = 1 : m
plot(cumsum((rand(1, n) > 0.5) - 0.5), 'Color', rand(1, 3)) ;
end

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by