I can I duplicate raws of variables?

2 visualizaciones (últimos 30 días)
Anna Maria
Anna Maria el 27 de Nov. de 2014
Comentada: Youssef Khmou el 28 de Nov. de 2014
I have imported an xls file spread sheet and I need to replicate six time each raw.
Ex. a1,b1,c1,d1 a2,b2,c2,d2 .................. ..................
Into a1,b1,c1,d1 a1,b1,c1,d1 a1,b1,c1,d1 a1,b1,c1,d1 a1,b1,c1,d1 a1,b1,c1,d1
a2,b2,c2,d2 a2,b2,c2,d2 a2,b2,c2,d2 a2,b2,c2,d2 a2,b2,c2,d2 .................. ..................

Respuesta aceptada

Youssef  Khmou
Youssef Khmou el 27 de Nov. de 2014
try this standard method
a=[1:3];
b=[];
for n=1:6
b=[b a];
end
  2 comentarios
Anna Maria
Anna Maria el 27 de Nov. de 2014
Thank You for your answer, it works and I will keep it in mind :-) but actually it is not what I need. The editor does not allow me (Or I am not used to it) to well explain my problem. Here is an image explaining my problem
Youssef  Khmou
Youssef Khmou el 28 de Nov. de 2014
hi Maria, you add a semicolon to the above code :
%....
b=[]
for n=1:6
b=[b;a];
end

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by