MATLAB Answers

Joe Liu

How to perform tall table assignment?

Asked by Joe Liu
on 15 Jun 2018 at 3:16
Latest activity Answered by Joe Liu
on 16 Jun 2018 at 3:57

I am trying to build a large table. I'm expecting the table to be 431,832×72. If I generate a normal table of this size, assignment and access is very, very slow. I'm assuming that I'm running out of memory.

I have tried to instead use a tall table. When I initialize my data I use the following code:

    trainingData = cell2table(cell(431832,72), 'VariableNames', tdColumns); % initialize out data
    trainingData = tall(trainingData); 

After I build the row to add, with a traditional table I would assign it by:

trainingData{rowIdx,:} = addRow;

However, if my table is tall, I get this error:

Indexed assignments of the form T(...,...) = B are not supported for tall table.

What's the proper way to build a large table?


Sign in to comment.




1 Answer

Answer by Joe Liu
on 16 Jun 2018 at 3:57

Well, turns out the problem isn't memory or any of that jazz. It's the tables.

I've got code that's been running over 24 hours that uses tables.

I switched to arrays and cells and it finished in under 5 minutes. Sheesh. My computer handled 400000x400 arrays and cells without any memory issues.

I guess tables are just stupid slow for large sets.


Sign in to comment.

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today