Memory required for struct array
이전 댓글 표시
it seems to me the numbers derived by Walter are not correct.
In this thread I attempt to fix, mostly by reverse engineering. Note that this are not documented and possibly depend . on the MATLAB version. Currently it's R2023a.
So there is no question explicitly formulated here
답변 (1개)
댓글 수: 4
Bruno Luong
2023년 8월 22일
clear s
s(100).foo = [];
whos s
clear s
s(99).foo = [];
whos s
960 - 952
so the number of extra bytes for each numel() must be 8, not 16.
Bruno Luong
2023년 8월 22일
Walter Roberson
2023년 8월 22일
At the moment, I do not immediately see a difference between your size predictions and my previous enumeration?
My discussion was slightly sloppy in taking about sizes for additional entries, under the assumption that at least one entry was assigned to for each fieldname; it probably would have been better to rewrite them to a base of no entries written to. On the other hand, when no entries at all are allocated to a field, it looks like the 8-bytes-per-element pointer table is not allocated at all.
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!