t_ok.m

来自「以上所传的内容为电力系统比较全面的分析程序,才用的是matlab编写m的文件」· M 代码 · 共 39 行

M
39
字号
function t_ok(cond, msg)%T_OK  Tests if a condition is true.%   t_ok(expr, msg) increments the global test count and if the expr%   is true it increments the passed tests count, otherwise increments%   the failed tests count. Prints 'ok' or 'not ok' followed by the%   msg, unless the global variable t_quiet is true. Intended to be%   called between calls to t_begin and t_end.%   MATPOWER%   $Id: t_ok.m,v 1.2 2004/08/23 20:59:48 ray Exp $%   by Ray Zimmerman, PSERC Cornell%   Copyright (c) 2004 by Power System Engineering Research Center (PSERC)%   See http://www.pserc.cornell.edu/matpower/ for more info.global t_quiet;global t_counter;global t_ok_cnt;global t_not_ok_cnt;if nargin < 2 | strcmp(msg, '')    msg = '';else    msg = [' - ', msg];endif cond    t_ok_cnt = t_ok_cnt + 1;else    t_not_ok_cnt = t_not_ok_cnt + 1;    if ~t_quiet        fprintf('not ');    endendif ~t_quiet    fprintf('ok %d%s\n', t_counter, msg);endt_counter = t_counter + 1;return;

⌨️ 快捷键说明

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