add columns to matrix
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
solleti prabhakarchary
el 7 de Ag. de 2022
Comentada: solleti prabhakarchary
el 7 de Ag. de 2022
A=(1 2 3 4)
B=(2 4 5 6 8 9 4 1)
C=[A,B]
C=1 0
2 0
3 0
4 0
0 2
0 4
0 5
0 6
0 8
0 9
0 4
0 1
like this i would like to generate matrix .Please help me in this how to write a program .
I need to add like this six files as shown above upto size 1084x6 matrix.
0 comentarios
Respuesta aceptada
Steven Lord
el 7 de Ag. de 2022
In general you can use blkdiag.
A=[1 2 3 6 ];
B=[4 5 5 6 9 8 7 6 9 6 8 6 9];
D=[4 1 2 3 5 68 9 6 9 6 9 6 9 6 9 63 45 82 85 96 74 52 63 10 30 23 65 6 66 33 66 ];
E=[5 4 6 5 4 8 9 6 9 6 8 6];
F=[4 8 9 7 8 6 9 6 8 2 21 3 6 56 36];
G=[7 8 9 9 6 8 6 45 25 33 66 33 14 25 36 36 12];
result = blkdiag(A, B, D, E, F, G).'
Más respuestas (1)
solleti prabhakarchary
el 7 de Ag. de 2022
Editada: solleti prabhakarchary
el 7 de Ag. de 2022
0 comentarios
Ver también
Categorías
Más información sobre Matrices and Arrays 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!