save calculated values in a loop to export in an excel-file
1 回表示 (過去 30 日間)
古いコメントを表示
hi,
after each iteration i want to create a vector in the loop in order to export it behind the for-loop into an excelfile. each iteration generates another ZFW value. How can i reach this ?
M = cell(28,1);
for i=1:3;
M{i} = UM(i,:);
IPV = M{i,1}(1);
IB = M{i,1}(2);
IWP = M{i,1}(3);
IK = M{i,1}(4);
IWS = M{i,1}(5);
Bundesland=2;
OptimierungPV_B_BANDU;
N(i)=ZFW;
end
xlswrite('testsheet1.xlsx', N,'Kapitalwerte');
1 件のコメント
dpb
2013 年 10 月 15 日
Looks like you already have created the vector N -- where's the problem?
You could be slightly more efficient by preallocating N but w/ only three elements it'll not be a noticeable difference. If you make the upper index much larger it'll begin to show up.
It's certainly not clear from the snippet posted why M is allocated as 28x1 as the loop only runs to 3 but one presumes this must be just a toy sample???
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!