Cannot create a table variable with a discontiguous index

19 views (last 30 days)
I am trying to create new columns based on a condition as described in the code below:
for j = 1:length(data.var1)
column = 1;
while data.var1(j) > value0
data{column,j} = value1;
column = column + 1;
end
end
I then get this error message:
"Cannot create a table variable with a discontiguous index."
Has anyone come up with a solution for such kind of isses with Matlab tables? I would like to avoid creating the columns at the same time with the table.

Answers (0)

Categories

Find more on Tables in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!