www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cgnormaliser/getvariables.m
function [variables, problem, othervariables] = getvariables(Norm,expr) %GETVARIABLES Group common input variables % % [COMMON, MSG, EXTRA] = GETVARIABLES(NORM, EXPR) returns the set of % inports to NORM that are also inports to EXPR in COMMON and all other % inports to EXPR in EXTRA. If the normalizer does not have exactly one % variable in common with EXPR, MSG will be a non-empty string containing % an appropriate message. % Copyright 2000-2005 The MathWorks, Inc. and Ford Global Technologies, Inc. problem = ''; [variables,unused] = cgvardiff(Norm.Xexpr,expr); lx = length(variables); if lx == 0 problem = 'One of the normalizer variables does not appear in the model.'; elseif lx > 1 problem = 'This normalizer has more than one variable in common with the model.'; end if nargout > 2 % find the other variables [unused, othervariables] = cgvardiff(expr,variables); end