Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Pull Out MATLAB Data to One Excel Spreadsheet[HELP!]
조회 수: 1 (최근 30일)
이전 댓글 표시
Your opinion is important to me!
First there is a MATLAB code(pseudo code):
for i = 1:2
A(i) = [C(i);D(i)];
B(i) = [E(i);F(i)];
end
The value for A and B in each loop are as follows,
A(1) =
'Rank' 'Ticker' '201205' 'Weight'
[ 1] 'B' [ 0.04] [ 0.03]
[ 2] 'E' [ 0.01] [ 0.10]
A(2) =
'Rank' 'Ticker' '201206' 'Weight'
[ 1] 'X' [ 0.02] [ 0.07]
[ 2] 'Y' [ 0.01] [ 0.11]
B(1) =
'Rank' 'Sector' '201205'
[ 1] 'S' [ 0.02]
[ 2] 'A' [ 0.01]
B(2) =
'Rank' 'Sector' '201206'
[ 1] 'T' [ 0.08]
[ 2] 'Y' [ 0.03]
Now comes to my question. How can I add a code in the loop so that all values of A and B generated from each loop can be pulled out into a single spreadsheet like the following picture?
The trick thing is data should be pulled out in different area of spreadsheet for different i.
BTW this is a simplified version. The actual problem has 500 loops instead of 2. A and B are much more complicated as well.
댓글 수: 0
답변 (1개)
Mark Whirdy
2012년 7월 18일
편집: Mark Whirdy
2012년 7월 18일
Append rows of empty cells {''} to the A, B cell-arrays as necessary
e.g.
repmat({''},1,3)
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!