building a diagonal matrix from another matrix!
Mostrar comentarios más antiguos
Hi eveybody,
im trying to build a diagonal matrix from another matrix in general form like following:
A=[a b,c d] -----> B[a 0 0 0,0 b 0 0,0 0 c 0,0 0 0 d]
dont want to write each array using blkdiag( ) function becuase my aimed matrix is too big.
tnx
1 comentario
Jos (10584)
el 7 de Mzo. de 2014
What are a,b,c, and d? scalars or matrices?
What do you mean by "too big"? Did you consider using sparse storage using, for instance, SPDIAGS?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Operating on Diagonal Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!