Pyramid made of Marbles (plots and calculation)

It provides the number of needed marbles to build a pyramid and plots it
221 Downloads
Updated 21 Mar 2014

View License

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
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0