How to know the size of a variable in MATLAB
I wrote a simple convenience function to handle just this problem. Usage is: >> x = ones(1000); >> ByteSize(x) 7.63 Mb I run R2007a, so the problem of Java objects not returning sizes may have been fixed in subsequent releases. Here’s the code: function ByteSize(in, fid) % BYTESIZE writes the memory usage of the provide … Read more