Collecting/tracking a score in a game
Version 1.0.0 (1.67 KB) by Dr. Kelsey Joy
Using for loops and running totals (recursion) to collect and sum up user inputs
Updated 27 Nov 2021
How to code for loops in MATLAB and how these can be used to collect user inputs. How to code running totals (recursion) to continuously sum up user inputs through each iteration of the loops.
This code is explained in the following YouTube Video:
For Loops and Running Totals (recursion): https://youtu.be/LnXguxboFNk
For more of my YouTube Videos, check out my MATLAB tutorial playlist: https://youtube.com/playlist?list=PLmB_c16LoAcWz_5qK1XpBlP0DiD6cgU-r
Also subscribe to my channel (Engineering with Dr. Kelsey Joy): https://www.youtube.com/channel/UCmZl7PfanvCILyiQ5R9rONA
Dr. Kelsey Joy (2023). Collecting/tracking a score in a game (https://www.mathworks.com/matlabcentral/fileexchange/102649-collecting-tracking-a-score-in-a-game), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with R2021b
Compatible with any release
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.