one dimensional random walk model MATLAB code??

A drunk man's random walk in one dimension

댓글 수: 3

Many people will be happy to help you with specific MATLAB related questions, but its unreasonable to ask for a full solution to what sounds like a homework question.
hi i am not sure this code is what you want.|
if true
y=0;
i=1;
while 1>0
a=sign(randn);
y(i+1)=y(i)+a;
pause(.00005);
plot(y)
i=i+1;
end
end
How often does he take a step? When does he go to sleep? What was he drinking?

댓글을 달려면 로그인하십시오.

 채택된 답변

Image Analyst
Image Analyst 2015년 4월 18일

1 개 추천

The most I can do is to offer up these two attached random walk demos that I've posted before (and you've probably already found if you've done a search of this forum). Feel free to adapt them to 1D by getting rid of the "y" calculation. If you have specific questions with your code, read these:
and then come back here.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

질문:

RSR
2015년 4월 16일

편집:

RSR
2015년 5월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by