How to create a cell array with constant data input without overwriting?

1 次查看(过去 30 天)
I’m running a code for different files, however I need to sore the results in a cell array without overwriting the info in each cell, I mean every time I run the code for a different file as a result it creates a second row of data in the cell array. Thanks.
  6 个评论
Fercho_Sala
Fercho_Sala 2021-6-10
@Stephen Cobeldick Apparently, it doesn't explain the fact how you can create a cell array or a vector without overwriting the results of the previous run.
Stephen23
Stephen23 2021-6-10
"Apparently, it doesn't explain the fact how you can create a cell array or a vector without overwriting the results of the previous run. "
Here, I highlighted it for you:
How to use indexing in loops is explained here:
See also:

请先登录,再进行评论。

回答(1 个)

kishore kavuru
kishore kavuru 2021-6-18
num_files = 10; cell_data = {}; for k = 1:num_files cell_data{end+1} = filenames(k);%example %file names end

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by