www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cgexpr/getFunctionName.m
function out = getFunctionName(E,UseInports) %getFunctionName Return name of expression with inputs % % STR = getFunctionName(E) % returns the string 'name(input1,input2,...,inputN)' % where the inputs are the names of the immediate inputs of the expression. % out = getFunctionName(E,UseInports) % uses variable inputs (inports) instead of immediate inputs in the expression when UseInports % is true. % Copyright 2012 The MathWorks, Inc. and Ford Global Technologies, Inc. if nargin>1 && UseInports inputList = mbcListString(pveceval(getinports(E),@getname)); else inputList = mbcListString(pveceval(getinputs(E),@getname)); end if isempty(inputList) out = E.name; else out = sprintf('%s(%s)',E.name,inputList); end