How do you avoid unnecessary copies when modifying table objects?

3 vues (au cours des 30 derniers jours)
Kyle Padilla
Kyle Padilla le 17 Fév 2022
Commenté : Kyle Padilla le 18 Fév 2022
I'd like to avoid the performance cost of copying large amounts of data inside of tables. For example, if I wanted to add or remove columns from the table via a function, how would you do that without it creating a copy? Do you need to use handle classes or can this be acheived with the built-in tables?

Réponse acceptée

Matt J
Matt J le 17 Fév 2022
Modifié(e) : Matt J le 17 Fév 2022
I think adding and removing columns from tables is largely like adding/removing elements from cell vectors, i.e., it involves no data copying.
  7 commentaires
Matt J
Matt J le 18 Fév 2022
Thanks for providing that test! I see it's not making a copy.
You're quite welcome. If your question is resolved, though, please Accept-click the answer.
Kyle Padilla
Kyle Padilla le 18 Fév 2022
Thanks @Walter Roberson, that clarifies it more for me.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by