I want to implement this matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Janet
el 23 de Feb. de 2012
0;Ip-l;0.............0
0;0;0;Ip-l;0.......0
.........................
0;0..............0;Ip-l
it is M-Nt x L matrix where M=128
L=65
p=64
1,3,5...columns are zero
2,4,6 columns have Ip-l in consecutive rows
1 comentario
Respuesta aceptada
Más respuestas (3)
John D'Errico
el 23 de Feb. de 2012
So many ways to do this. My favorite to recognize it as a block diagonal matrix.
d = repmat({[0 Ip-1]},1,64);
M = blkdiag(d{:});
If you want your matrix to be sparse (it surely should be, so why not use the capability?)
d = repmat({sparse([0 Ip-1])},1,64);
M = blkdiag(d{:});
I suppose this would work too. Making it sparse is trivial.
M = toeplitz([0, Ip-1,zeros(1,126)]);
M(2:end,:) = [];
Sean de Wolski
el 23 de Feb. de 2012
look at diag, and eye.
doc diag
doc eye
Please provide an actual matrix we can copy and paste into MATLAB (small example) if you would like more detail.
0 comentarios
Ver también
Categorías
Más información sobre Operating on Diagonal 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!