Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

cell performance in structure

조회 수: 2 (최근 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