Plotting for loop data
6 ビュー (過去 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!