フィルターのクリア

How to build these vectors?

1 回表示 (過去 30 日間)
Mahdi
Mahdi 2013 年 7 月 9 日
I want to build all vector P's satisfying this: P=[p1 p2 ... pk] pi=1,...,N ,i=1,...,k for i>j : pi > pj Note that I know how to build them using k for loops. I need a code which is useful for all pairs of (N,k) Thanks

採用された回答

Jan
Jan 2013 年 7 月 9 日
編集済み: Jan 2013 年 7 月 9 日
Do you mean something like: FEX: VChooseK?
  2 件のコメント
Mahdi
Mahdi 2013 年 7 月 9 日
I tried to use that but I didn't get anything. I mean for example (N,k)=(5,3) it produces all of these vectors: [1 2 3] [1 2 4] [1 2 5] [1 3 4] [1 3 5] [1 4 5] first element is fixed to one.
Jan
Jan 2013 年 7 月 9 日
編集済み: Jan 2013 年 7 月 9 日
Why is the first element fixed? I'd expect:
R = VChooseK(1:5,3)
R = [1 2 3
1 2 4
1 2 5
1 3 4
1 3 5
1 4 5
2 3 4
2 3 5
2 4 5
3 4 5]
"I didn't get anything" does not allow to provide assistance.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by