Hi all,
I have a program which produces a 40227 by 50 double matrix. I'd like to optimize storage so I want to check total memory usage. It is in structural variable "canti". If I run whos, MATLAB shows:
K>> whos Name Size Bytes Class Attributes INPname 1x60 120 char a 1x1 8 double ans 1x1 1 logical bondL1 1x1 8 double bondL2 1x1 8 double bondR1 1x1 8 double bondR2 1x1 8 double canti 1x1 112 canbeam
However, structural variable "canti" contains a few large variables as follows:
K>> canti.disans = inpt: [40227x1 double] val: [40227x50 double] full: [40227x50 double] trial: [40227x50 double]
Why would "canti" only uses 112 bytes of memory while it contains variables of 40227 by 50 matrix? According to my test, if I do:
>> a = rand(40227, 50);>> whos Name Size Bytes Class Attributes a 40227x50 16090800 double
A 40227 by 50 double should cost 16090800 bytes in memory, which is 15.3454 MB. If MATLAB is not showing the real memory usage for some reason, then how can I check the memory usage during and after my program?
Many thanks!
Best Answer