how matlab stores graphics objects?
조회 수: 1 (최근 30일)
이전 댓글 표시
when i create a figure i noticed that it have alot of propeties and each property hold values,
that means alot of bytes, but the figure size seems to be 8 bytes despite all the properties values which are having a greater size,
my question is if properties values are not stored on (RAM), then where the properties values are stored then, and how matlab calls them that fast if they are really not stored on RAM.
please don't give me links, and thanks in advance
댓글 수: 3
채택된 답변
Steven Lord
2021년 2월 27일
The Bytes column of the output of whos does not tell the "truth, whole truth, and nothing but the truth" for certain situations.
A = zeros(100);
B = A;
whos A B
A and B do not necessarily point to a different block of 80,000 bytes due to the copy-on-write behavior of MATLAB.
f = figure;
whos f
This does not list the full amount of memory required to store all the data and properties associated with a figure window.
Use that data as guidance, not law.
And no, there is no way to get the actual amount of memory associated with f (maybe walking the list of properties in a MEX-file, but again things like copy-on-write would complicate even that.)
댓글 수: 0
추가 답변 (2개)
Bruno Luong
2021년 2월 27일
편집: Bruno Luong
2021년 2월 27일
All graphic objects are class "handle". Handles is a identify to designate the object and it's obviously 8 bytes as showed by whos command (ihanle is probaby a pointer or or hashcode, we shoudn't care about the internal meaning).
All the properties and RAM storage are not showed with whos.
Matlab might share RAM for many the data, that happens with object class such as graphical underlined and hierarchical objects.
Details of grahical properties are subjected to change from version to version.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!