?? eval.m
字號:
function r = eval(obj, vars)% GPCONSTRAINT/EVAL Implements EVAL command for GP constraints.%% Returns either a true (logical 1) or a false (logical 0) if all% GP variables are specified or a reduced GP constraint.%sz = size(vars);if( ~isa(vars,'cell') || sz(2) ~= 2 ) error('Second argument should be a cell array with 2 rows');end% check that all the gp variables are positive (implicit GP constraint)for k = 1:size(vars,1) var_values = vars{k,2}; if any(var_values <= 0) error('GP variables must have positive value.'); endend% evaluate different flavors of gpconstraintif( strcmp(obj.type,'<=') ) r = (eval(obj.lhs,vars)) <= (eval(obj.rhs,vars));elseif( strcmp(obj.type,'==') ) r = (eval(obj.lhs,vars)) == (eval(obj.rhs,vars));end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -