If I declare an object to be a subclass of handle classdef obj < handle my object is now essentially a "pointer" to some memory somewhere. How do I find out how much memory my object is using up?

For example, say I have a class foo with a field bar

classdef foo < handle 
properties
    bar = randn(1000);
end

bar takes up 8 megabytes (8 bytes * 1 million numbers)

but if I type

obj = foo();
whos('obj');

I get

Name      Size            Bytes  Class    Attributes

  obj      1x1                60  foo                

How do I find out how much total memory obj points to?

Edit
Report