Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

cell performance in structure

1 view (last 30 days)
Yingke
Yingke on 21 Feb 2012
Closed: MATLAB Answer Bot on 20 Aug 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 Comment
James Tursa
James Tursa on 21 Feb 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.

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!