Loop to write data in excel from 1 st iteration to n th iteration
    2 ビュー (過去 30 日間)
  
       古いコメントを表示
    
    naresh bhimchand
 2019 年 12 月 3 日
  
    
    
    
    
    回答済み: Marcel Kreuzberg
      
 2019 年 12 月 3 日
            for t = 0:1:10
a = cos(t).*[2 3;4 5]
b = cos(t).*[6 5;4 6]
c = a+b
d = eig(c)
for i = 1:length(d)
    r = 2*3*d
    w(:,i+1) = r
    csvwrite("excercise.csv",w(:));
end
end
In the above code it only storing the last i th iteration value in .csv file but i like store the i value from 1 to 10 please help me to solve this and thank you in advance.
0 件のコメント
採用された回答
  Marcel Kreuzberg
      
 2019 年 12 月 3 日
        for t = 0:1:10
a = cos(t).*[2 3;4 5]
b = cos(t).*[6 5;4 6]
c = a+b
d = eig(c)
r = 2*3*d
w(:,t+1) = r
end
csvwrite("excercise.csv",w);
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
				Help Center および File Exchange で Data Import from MATLAB についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

