display.m

来自「一个matlab的将军模型」· M 代码 · 共 27 行

M
27
字号
function display(s)

% Display the content of a "region" object.
%
% Description:
%   By calling "display(s)" or simply typing "s" without the semicolon at
%   the command line, the content of the region "s" is displayed in the
%   MATLAB command window.
%
% See Also:
%   region,set_state,isinregion,isuniverse

fprintf(1,'Total states: %d\n',s.nstate)
fprintf(1,'States in region: ')
if isempty(s)
  fprintf(1,'None')
elseif isuniverse(s)
  fprintf(1,'All')
else
  for k = 1:s.nstate
    if isinregion(s,k)
      fprintf(1,'\t%d',k)
    end
  end
end
fprintf(1,'\n')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?