Saving data after each iteration

1 回表示 (過去 30 日間)
Sydney Kehoe
Sydney Kehoe 2021 年 6 月 22 日
コメント済み: Sydney Kehoe 2021 年 6 月 23 日
Hello so I'm trying something a bit different then before, so my code is as follows:
all_pulse = [ ];
files = importdata('name_files2.txt');
for i = 1:length(files)
[C_pulse, D_pulse] = One_Person(files{i}); %this is a pre-defined function
save('all_pulse', 'C_pulse', 'D_pulse') %what I have so far
end
The only thing I am having trouble with is that I want to save the outputs of my function (C_pulse and D_pulse) into the matrix all_pulse after each iteration of the loop so that I have all the data I need from each file in the larger matrix. Not sure how to do this. Thanks,
  3 件のコメント
Mathieu NOE
Mathieu NOE 2021 年 6 月 23 日
hello
what size have C_pulse, D_pulse ?
Sydney Kehoe
Sydney Kehoe 2021 年 6 月 23 日
Each iteration yields 6 values for C_pulse and 6 for D_pulse

サインインしてコメントする。

採用された回答

KSSV
KSSV 2021 年 6 月 23 日
C_pulse = cell(N,1) ;
D_pulse = cell(N,1) ;
files = importdata('name_files2.txt');
for i = 1:length(files)
[C_pulse{i}, D_pulse{i}] = One_Person(files{i}); %this is a pre-defined function
end
  1 件のコメント
Sydney Kehoe
Sydney Kehoe 2021 年 6 月 23 日
Thanks so much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeArray Geometries and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by