split a rectangular matrix
Mostrar comentarios más antiguos
i have a matrix as
input = [1 0 0 0; 0 1 0 0; 0 0 1 0];
how can i split a the input matrix as
output1 = [1 0 0 0; 0 0 0 0; 0 0 0 0];
output2 = [0 0 0 0; 0 1 0 0; 0 0 0 0];
output3 = [0 0 0 0; 0 0 0 0; 0 1 0 0];
store output1-3 in a single matrix named output with n-dimension.
matrix input can be of any dimension but rectangular matrix and only diagonal values will be there.
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!