www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@localmod/RespFeatName.m

    function BNames= RespFeatName(L)
% LOCALMOD/RESPFEATNAME default names for rf modeldev objects

%  Copyright 2000-2011 The MathWorks, Inc. and Ford Global Technologies, Inc.



BNames= cell(size(L.Values,1),1);
for i=1:length(L.Type)
   if ~isempty( strfind(L.Type( i ).Function,'Value') )
      % thus adds the value to the name
      val= L.Values(i,:);
		if length(val)==1
			vstr= strrep(num2str(abs(val)),' ','_');
			if val<0
				BNames{i} = [(L.Type(i).Name),'_less',vstr];
			elseif val>0
				BNames{i} = [(L.Type(i).Name),'_plus',vstr];
			else
				BNames{i} = [(L.Type(i).Name),'_0'];
			end
		else
			vstr= strrep(sprintf('%.3g,',val),' ','_');
			
			BNames{i} = [(L.Type(i).Name),'_[',vstr(1:end-1),']'];
		end
	else
      BNames{i} = (L.Type(i).Name);
   end
end