📄 memblock.m
字号:
function mem=memblock% Compute the size of the largest contiguous memory block; works only on PC's%% Written by: E. R.: December 31, 2006% Last updated:%% mem=memblock% OUTPUT% mem size of the largest contiguous memory block in bytesif ~ispc error(' This function works only on PC''s.')end% temp=tokens(evalc('feature(''memstats'')'),'\n');temp=textscan(evalc('feature(''memstats'')'),'%s','delimiter','\n'); % "feature" % is an undocumented built-in functiontemp=temp{1};for ii=length(temp)-10:-1:1 if strcmpi(temp(ii),'Largest Contiguous Free Blocks:')% text=tokens(temp{ii+1},' '); text=textscan(temp{ii+1},'%s'); text=text{1}; break endendstr=text{end};mem=hex2dec(str(2:end-1));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -