I can I duplicate raws of variables?

1 次查看(过去 30 天)
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 .................. ..................

采纳的回答

Youssef  Khmou
Youssef Khmou 2014-11-27
try this standard method
a=[1:3];
b=[];
for n=1:6
b=[b a];
end
  2 个评论
Youssef  Khmou
Youssef Khmou 2014-11-28
hi Maria, you add a semicolon to the above code :
%....
b=[]
for n=1:6
b=[b;a];
end

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by