Pyramid made of Marbles (plots and calculation)
This document provides the number of needed marbles to build a pyramid that has an n-number of marbles on one side.
It also plots the result pyramid
Examples that you can type to start:
N_of_Marbles (3);
Calculates how many marbles are needed for a 3-marble side. Result: (3 + 2 + 1) for the first floor + (2 + 1) for the second, plus the last floor (1) = 10
Plot_Marbles(5,300);
Plots the pyramid, with balls of relative size of 300
Plot_Evolution(5);
Plots the evolution of the number of needed marbles from 1 to 5
Written by Francesc Melia Sune
Cite As
Francesc Melia (2024). Pyramid made of Marbles (plots and calculation) (https://www.mathworks.com/matlabcentral/fileexchange/45975-pyramid-made-of-marbles-plots-and-calculation), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
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.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |