HOW TO PUT ONE MATRIX UNDER ANOTHER AND MAKE IT A SINGLE MATRIX

3 visualizaciones (últimos 30 días)
HEMRAJ PATEL
HEMRAJ PATEL el 30 de Nov. de 2021
Respondida: DGM el 30 de Nov. de 2021
I HAVE MATRIX A AND B AND I HAVE TO CREATE C USING A AND B. WHAT COMMAND DO I NEED. ALSO I HAVE N NO. OF MATRIX THAT I NEED TO STICH LIKE THIS WAY.
A = [1 2 3;4 5 6;7 8 9]
B = [1 2 2;2 2 2;1 1 1]
C = [1 2 3;4 5 6;7 8 9;1 2 2;4 5 6;7 8 9]

Respuesta aceptada

DGM
DGM el 30 de Nov. de 2021
A = [1 2 3;4 5 6;7 8 9]
A = 3×3
1 2 3 4 5 6 7 8 9
B = [1 2 2;2 2 2;1 1 1]
B = 3×3
1 2 2 2 2 2 1 1 1
% concatenate
C = [A; B]
C = 6×3
1 2 3 4 5 6 7 8 9 1 2 2 2 2 2 1 1 1
% or
C = cat(1,A,B)
C = 6×3
1 2 3 4 5 6 7 8 9 1 2 2 2 2 2 1 1 1

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by