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?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Azzi Abdelmalek
2017-5-7
If the order is not important
v=[0 0.625 1.25 2.5]
id=nchoosek(1:4,3)
out=v(id)
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!