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

A positive integer number N is represented as a sum of K positive integer numbers.
35 téléchargements
Mise à jour 12 jan. 2017

Afficher la licence

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

Citation pour cette source

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. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2007a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.0.0.0