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
Citation pour cette source
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. Récupéré le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxCatégories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
Version | Publié le | Notes de version | |
---|---|---|---|
1.0.0.0 |