how to combine matrices
Mostrar comentarios más antiguos
I have two matrices: A & B ... I want to combine them so that every element will be near the other one's corresponding element. For example something like C matrix.
A=[1,2;3,4]
B=[5,6;7,8]
C=[15,26; 37, 48]
3 comentarios
Mohammad Sami
el 23 de En. de 2020
Editada: Mohammad Sami
el 23 de En. de 2020
Option 1
str2double(strcat(string(A),string(B)))
Option 2
str2double(reshape(compose('%i%i',A(:),B(:)),size(A,1),size(A,2)))
Walter Roberson
el 23 de En. de 2020
Note that if you have negative entries then you will need to define what the results are expected to be.
Ani Asoyan
el 23 de En. de 2020
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Resizing and Reshaping 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!