makeChange(amount,d​enomination)

版本 1.0.0.0 (3.6 KB) 作者: Toby
Determines combinations of integers (denominations) which sum to a specified integer amount
58.0 次下载
更新时间 2016/4/29

查看许可证

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]);

引用格式

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

MATLAB 版本兼容性
创建方式 R2015b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Data Type Conversion 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0