Borrar filtros
Borrar filtros

how to combine different matrix dimensions into a single matrix ?

21 visualizaciones (últimos 30 días)
rajesh kumar
rajesh kumar el 16 de Mayo de 2018
Comentada: Rik el 27 de Mayo de 2018
for example i having m1=10*2, m2=10*3, m3=10*6; i want m=[m1,m2,m3] but due to different dimension it is not getting so any possibility to combine.

Respuestas (1)

Rik
Rik el 16 de Mayo de 2018
Matlab arrays must be rectangular. The concatenation you show is possible, so it should only give errors if you dimension description is wrong, or if the data types are not the same.
m1=rand(10,2);
m2=rand(10,3);
m3=rand(10,6);
%concatenating to cell always works:
m_cell={m1,m2,m3};
%concatenation to a normal array should work with your example:
m=[m1,m2,m3];
  1 comentario
Rik
Rik el 27 de Mayo de 2018
Did this suggestion solve your problem? If so, please consider marking it as accepted answer. It will make it easier for other people with the same question to find an answer. If this didn't solve your question, please comment with what problems you are still having.

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by