필터 지우기
필터 지우기

Create a curved random walking path

조회 수: 2 (최근 30일)
Dineth Senevirathne
Dineth Senevirathne 2017년 7월 7일
댓글: Walter Roberson 2017년 7월 7일
Hello,
I need to create a random curved walking path of a person.
  • it should be plot point by point like an actual walk
  • step size is 50 (length between 2 steps)
  • should be random
  • axes should be limited to 0 - 1000 (x=0 to 1000 and y= 0 to 1000)
can anyone help me with a code?
check the attached picture to get a clear idea
  댓글 수: 4
Dineth Senevirathne
Dineth Senevirathne 2017년 7월 7일
Above path in the picture is not random.
This is a walking simulation of a person. Imagine a person is at a position (x,y) then he randomly select to walk forward or left or right.but step size is 50.(50 cm forward etc.)
Walter Roberson
Walter Roberson 2017년 7월 7일
If your rule is that a person can randomly select between left, right, or forward, then that is a standard random walk modified so that the person cannot immediately move back to where they came from. Such walks cluster around the origin point, and can very definitely go negative x and negative y, which your xlim and ylim requirements would not be able to show. It is not what you refer to as a curved random walk.
If the rule is that you can go more-positive-y ("up") or less-positive-y ("down") or more-positive-x ("right") then you get less clustering around the origin point, because such rules would not permit moving to any point with a lesser x than you have reached. However, such a path is not one you would call curved either -- not unless you can define a bias on the random selection that acts to tend to curve the path.
Curved paths are easier to create if you do not confine to turns that are multiples of 90 degres, even if you fix the step size.

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

답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by