Info
この質問は閉じられています。 編集または回答するには再度開いてください。
How can I create this matrix?
2 ビュー (過去 30 日間)
古いコメントを表示
I would like to create a matrix in Matlab. I have variable Y(i,j,k) where
i=0,1,2,...,v j=1,2,...,v+1 and q=1,2,...,Q
also
i~=j (i not equal j)
for example when v=2 and q=2 the matrix will be
[1 1 0 0 0 0 1 1 0 0 0 0;
0 0 1 1 1 1 0 0 0 0 0 0 ]
when v=2 and q=3 the matrix will be
[1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0;
0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0]
when v=3 and q=2 the matrix will be
[1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0;
0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0;
0 0 0 0 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0]
Note that the size of matrix is (v,2*(q*v)+q*(v*(v-1))). Can you help me please to create this matrix for any number of v and q?
Regards,
Ghazwan.
2 件のコメント
Image Analyst
2014 年 12 月 11 日
In "variable Y(i,j,k)" where is q? And in your examples, you show 2D matrices, yet Y is a 3D array. What matrix are you showing?
Guillaume
2014 年 12 月 11 日
It's certainly very unclear how the matrices are generated. v appear to be the number of rows and q the number of repeated columns. How the 1 appear in there and what i, j, k have to do with it is not explained.
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!