Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How can I create this matrix?

2 visualizaciones (últimos 30 días)
ghazwan alsoufi
ghazwan alsoufi el 11 de Dic. de 2014
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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 comentarios
Image Analyst
Image Analyst el 11 de Dic. de 2014
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
Guillaume el 11 de Dic. de 2014
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.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by