Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

cell performance in structure

1 vue (au cours des 30 derniers jours)
Yingke
Yingke le 21 Fév 2012
Clôturé : MATLAB Answer Bot le 20 Août 2021
Dear All
Do you have any suggestions about how to improve the performance of cell matrix?
I found that if we are going to intensively manipulate a big cell matrix in a structure, it is faster to make a copy, do what we want to do on this copy and then assign the copy back to structure. Is it right? Why? Is it means that getting the field of one structure has a big overhead?
Another question, is there any good way to delete a row of elements in cell matrix besides cell_mat(mask,:) = []?
Thanks a lot in advance.
  1 commentaire
James Tursa
James Tursa le 21 Fév 2012
Please post some code showing us exactly how you are extracting the cell matrix, manipulating it, etc, etc. Then we can comment on better ways of doing things (if we know any). Your method of deleting row element is a good one as long as you are not doing this repeatedly for different masks. If that is the case, it would be best to construct the overall mask up front and then delete the rows only once, since every time you delete rows it causes a data copy of the remaining rows to take place.

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by