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 (최근 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!