I have a matrix
a= 1 1 1
1 1 1
1 1 1
b= 2 2 2
2 2 2
2 2 2
How do I combine them into
1 2 1 2 1 2
1 2 1 2 1 2
1 2 1 2 1 2

 Respuesta aceptada

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy el 14 de Ag. de 2018
Editada: Yuvaraj Venkataswamy el 14 de Ag. de 2018

2 votos

5 comentarios

Lanceric Tse
Lanceric Tse el 14 de Ag. de 2018
which command?
Yuvaraj Venkataswamy
Yuvaraj Venkataswamy el 14 de Ag. de 2018
Check the above link, that will provide answer.
if true
Y = b(:,[1;1]*(1:size(b,2)));
Y(:,1:2:end) = a
end
KALYAN ACHARJYA
KALYAN ACHARJYA el 14 de Ag. de 2018
@Yuvaraj Great
Yuvaraj Venkataswamy
Yuvaraj Venkataswamy el 14 de Ag. de 2018
Thank you @Kalyan

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by