Creation of matrices (24,72) M1&M2 ?
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
ET-TAOUSSI mehdi
el 2 de Feb. de 2016
Comentada: Stephen23
el 3 de Feb. de 2016
Hello. I want to create matrices (24,72) that have the following forms:

0 comentarios
Respuesta aceptada
Stephen23
el 2 de Feb. de 2016
Editada: Stephen23
el 3 de Feb. de 2016
C1 = repmat({[1,1,0]},1,24);
M1 = blkdiag(C1{:});
And the second is either:
M2 = circshift(M1,[0,1]);
or
C2 = repmat({[0,1,1]},1,24);
M2 = blkdiag(C2{:});
2 comentarios
Stephen23
el 3 de Feb. de 2016
Another simple method is to use eye, zeros and reshape:
M1 = reshape([eye(24);eye(24);zeros(24)],24,72);
M2 = reshape([zeros(24);eye(24);eye(24)],24,72);
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!