If each element of vector with size (1,3) takes one value of 4 discrete values. How can I obtain all possible combinations of this vector?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Adi Nor
el 7 de Mayo de 2017
Comentada: Azzi Abdelmalek
el 7 de Mayo de 2017
If each element of vector with size (1,3) takes one value of 4 discrete values [0 0.625 1.25 2.5]. How can I obtain all possible combinations of this vector?
0 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 7 de Mayo de 2017
If the order is not important
v=[0 0.625 1.25 2.5]
id=nchoosek(1:4,3)
out=v(id)
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!