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?

採用された回答

Azzi Abdelmalek
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)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by