"Bytes" is 0 in Variable Editor

a.data=rand(100,1);
b=dlnode(rand(100,1));
Then you'll find in Variable Editor the "Bytes" of a.data or b.data is 0!
Why?
Verified on 2008a and 2010b.
While it's correct in Workspace Window.
Thanks a lot.

 Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 15 Nov. 2011

1 Stimme

If you do a=struct() or b=[], you will see that the variable a and b have been declared but not assigned value. Thus, a and b have not taken any memory bytes to store the value. Once you assign a value, the number of bytes will change depending on the size of the data stored.

5 Kommentare

Shunchao Wu
Shunchao Wu am 15 Nov. 2011
Thanks, Jiang.
I've modified my question, 呵呵。
Fangjun Jiang
Fangjun Jiang am 15 Nov. 2011
What do you mean "Variable Editor"?
Shunchao Wu
Shunchao Wu am 16 Nov. 2011
For 2011b:
http://www.mathworks.cn/help/techdoc/matlab_env/f10-42271.html
Fangjun Jiang
Fangjun Jiang am 16 Nov. 2011
Thank you! I've verified in R2010b that it is showing 0 bytes.
I think this might be a bug. Please report to TMW. Good finding!
Shunchao Wu
Shunchao Wu am 16 Nov. 2011
OK, I'll report this bug.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 15 Nov. 2011

0 Stimmen

In R2008b, I did
a.data=rand(100,1);
openvar a
but I could not see any "Bytes" field in the Variable Editor.
Same when I used the Workspace Browser to examine a.

1 Kommentar

Shunchao Wu
Shunchao Wu am 16 Nov. 2011
On Microsoft Windows systems, you can right-click any column header to show the "Bytes" column.

Melden Sie sich an, um zu kommentieren.

Kategorien

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by