Plotting for loop data
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi, I'm relatively new to MATLAB and I'm a bit stuck on this problem. I am trying to create a random walk simulation by having a coin toss determine whether the "walker" will step left or right. I would like to plot every value of the position after each coin toss, but I only end up with the final position value. How can I plot every value? Here is what I have. Thanks in advance.

댓글 수: 0
답변 (1개)
madhan ravi
2018년 11월 21일
Use iterator as an index so that overwriting is avoided. Plus upload your code intead of picture next time onwards.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!