dispx.m

来自「approximate reinforcement learning」· M 代码 · 共 30 行

M
30
字号
function d = dispx(message, verb, level)
% Message display with extended functionality
%   D = DISPX(MESSAGE, VERB, LEVEL)
% Displays a message conditioned on its priority.
%
% Parameters
%   MESSAGE     - message to display
%   VERB        - verbosity level of current context
%   LEVEL       - priority level of the message (the lower the number, the higher the
%               priority)
%
% Returns:
%   D           - 1 if string displayed, 0 otherwise

if nargin < 2,
    verb = Inf;
end;
if nargin < 3,
    level = 0;
end;

if level <= verb, 
    if ischar(message), disp(message); 
    else message        % display the message as a normal variable
    end;
    d = 1;
else d= 0; 
end;

% END dispx() RETURNING d =============================================================

⌨️ 快捷键说明

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