I can I duplicate raws of variables?

조회 수: 1 (최근 30일)
Anna Maria
Anna Maria 2014년 11월 27일
댓글: Youssef Khmou 2014년 11월 28일
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
Anna Maria
Anna Maria 2014년 11월 27일
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 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에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by