Plotting for loop data
Ältere Kommentare anzeigen
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.

Antworten (1)
madhan ravi
am 21 Nov. 2018
0 Stimmen
Use iterator as an index so that overwriting is avoided. Plus upload your code intead of picture next time onwards.
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!