Does adding variables to table cause Matlab to re-write the entire table in memory?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Rueben Mendelsberg
el 31 de Oct. de 2023
Comentada: Rueben Mendelsberg
el 31 de Oct. de 2023
If I add columns/variables to a table that already exists, is the entire table rewritten to memory like a matrix is when adding an element outside of the existing matrix size?
0 comentarios
Respuesta aceptada
Walter Roberson
el 31 de Oct. de 2023
No. Internally, tables have a cell array with one cell entry for each variable. The cell array would have to be extended, but that is a relatively inexpensive operation (the cell contents do not have to be copied, just the pointers to the entries.)
Now, adding new rows on the other hand requires rewriting each cell array member.
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!