您可以使用WHOS的程序化形式:
>> x = rand(1024);
>> w = whos
w =
name: 'x'
size: [1024 1024]
bytes: 8388608
class: 'double'
global: 0
sparse: 0
complex: 0
nesting: [1x1 struct]
persistent: 0
Run Code Online (Sandbox Code Playgroud)