Represented a positive integer number as a sum of multiple positive integer numbers.

バージョン 1.0.0.0 (1.43 KB) 作成者: Pramit Biswas
A positive integer number N is represented as a sum of K positive integer numbers.
ダウンロード: 35
更新 2017/1/12

ライセンスの表示

A positive integer number N can be represented as a
sum of K positive integer numbers.
i.e, N = n1 + n2 + ... + nk
E.g. 1: 6(N) can be represented as a sum of 2(K) numbers in following way: (1+5), (2+4), (3+3).
E.g. 2: 8(N) can be represented as a sum of 3(K) numbers in following way: (1+1+6), (1+2+5), (1+3+4), (2+2+4), (2+3+3).
To run this function, sample input:
N_as_sum_of_K_numbers(8,3)
Points to remember:
1. N, K both should be positive integer
2. do not give more than two inputs, it will give wrong or no result

引用

Pramit Biswas (2024). Represented a positive integer number as a sum of multiple positive integer numbers. (https://www.mathworks.com/matlabcentral/fileexchange/61122-represented-a-positive-integer-number-as-a-sum-of-multiple-positive-integer-numbers), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2007a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0