フィルターのクリア

building a matrix with conditions for rows and columns

1 回表示 (過去 30 日間)
Manoj
Manoj 2014 年 6 月 4 日
編集済み: Azzi Abdelmalek 2014 年 6 月 4 日
I want to build a matrix in the following manner
Enter number of switching elements – “k”
Enter number of coupling edges- “n”
Total structures possible= fact (n+k-1)/ (fact (k)*fact (n-1))
Total number of columns=n
Total number of rows= All possible combinations with sum=k
For example
n=10
k=9
Total Structures=48620
e12 e13 e14 e15 e23 e24 e25 e34 e35 e45
0 0 0 0 0 0 0 0 0 9
0 0 0 0 0 0 0 0 1 8
0 0 0 0 0 0 0 0 2 7
0 0 0 0 0 0 0 0 3 6
0 0 0 0 0 0 0 0 4 5
0 0 0 0 0 0 0 0 5 4
0 0 0 0 0 0 0 0 6 3
0 0 0 0 0 0 0 0 7 2
0 0 0 0 0 0 0 0 8 1
0 0 0 0 0 0 0 0 9 0
0 0 0 0 0 0 0 1 0 8
0 0 0 0 0 0 0 1 1 7
.
.
.
So on till I have this 48620*10 matrix in the same manner as shown above. I then have to perform calculations with this matrix as well
BR Manoj

回答 (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