makeChange(amount,d​enomination)

Version 1.0.0.0 (3,56 KB) von Toby
Determines combinations of integers (denominations) which sum to a specified integer amount
58 Downloads
Aktualisiert 29 Apr 2016

Lizenz anzeigen

Works recursively to determine the number of combinations (and optionally the combinations themselves) of sets of specified integers (denominations) that can be formed to sum to the input amount.
example:
To determine the number of possible ways to make change for a dollar using pennies, nickels, dimes, and quarters; one would call:
[nCombinations, combinations] = makeChange(100,[1,5,10,25]);

Zitieren als

Toby (2024). makeChange(amount,denomination) (https://www.mathworks.com/matlabcentral/fileexchange/56834-makechange-amount-denomination), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2015b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0.0