Info

此问题已关闭。 请重新打开它进行编辑或回答。

cell performance in structure

1 次查看(过去 30 天)
Yingke
Yingke 2012-2-21
关闭: MATLAB Answer Bot 2021-8-20
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 个评论
James Tursa
James Tursa 2012-2-21
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.

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by