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

조회 수: 2 (최근 30일)
Fercho_Sala
Fercho_Sala 2021년 6월 9일
댓글: Fercho_Sala 2021년 6월 25일
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