getfidx.m

来自「模糊神经网络采用matlab编程 o install NEFCON follow」· M 代码 · 共 49 行

M
49
字号
function [idx] = getfidx(fismat, vartype, name); %GETFIDX  Get varindex of in- or output variable 'name'. %         Returns 0 if 'name' doesn't exist in fismatrix. %%         fismat:  fismatrix%         vartype: 'input' or 'output'%         name:    name of variable%% See also fuzzy.%	Author(s): Andreas Nuernberger, 08/1996  %#realonly if nargin ~= 3, 	error('Too many or too few input arguments!'); end  NumInputs	= getfis(fismat, 'NumInputs'); NumOutputs	= getfis(fismat, 'NumOutputs'); InLabels	= setstr(getfis(fismat, 'InLabels')); OutLabels	= setstr(getfis(fismat, 'OutLabels'));  mbintscalar(NumInputs); mbintscalar(NumOutputs);  mfname = deblank(name); idx = 0;  if strcmp(deblank(vartype), 'input'),     for i = 1:NumInputs,         if strcmp(deblank(InLabels(i,:)), mfname)         	idx = i;         end     end else 	for i = 1:NumOutputs,         if strcmp(deblank(OutLabels(i,:)), mfname)     		idx = i;         end 	end end     

⌨️ 快捷键说明

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