how to get combination

1 visualización (últimos 30 días)
Mohammad Sohel Rana
Mohammad Sohel Rana el 1 de Jun. de 2018
Comentada: Walter Roberson el 1 de Jun. de 2018
I am seeking a help.
Suppose I have a number like 100. How I can get possible combination for this number. It can make two matrix for combinations A=[100,50,25,20,10,5,4,2,1] B=[1,2,4,5,10,20,25,50,100] how i can solve for big number?

Respuesta aceptada

Rishabh Rathore
Rishabh Rathore el 1 de Jun. de 2018
Here's what I understand from your question, you want all divisors of a number.
You can use in-built 'divisors()' function.
Refer divisors

Más respuestas (1)

Greg
Greg el 1 de Jun. de 2018
Editada: Greg el 1 de Jun. de 2018
If you have the Symbolic Math Toolbox, you can use the divisors function. Then it's a simple flip to get the opposite order.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by