memblock.m

来自「实现地震勘探中」· M 代码 · 共 33 行

M
33
字号
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 + =
减小字号Ctrl + -
显示快捷键?