📄 nefmat.m
字号:
function nefmatout=nefmat(nefmatrix); % NEFMAT set globals using nefcon-matrix or create nefcon-matrix using globals % % nefmat(nefmatrix) set globals % nefmatrix=nefmat creates nefmatrix using globals % % Globals: % NEFCON_SYSNO - Number of actual nefconsystem (if multiple systems used) % NEFCON_STAT - Status of execution % NEFCON_RULE - Selected rule generation % NEFCON_OPT - Selected optimization method % NEFCON_FERR - Selected error calculation % NEFCON_RATE - Selected learning rate % NEFCON_IFM - intial fismatrix name (rule learning disabled) % NEFCON_EFM - error fismatrix % NEFCON_EFMN - error fismatrix name % NEFCON_FIS - nefcon fismatrix % NEFCON_NUMIN- number of inputs % NEFCON_RBT - rulelearning bound type (phase 1) % NEFCON_RBND - nof steps for rulelearning (bound phase 1) % NEFCON_RBT1 - rulelearning bound type (phase 2) % NEFCON_RBND1- nof steps for rulelearning (bound phase 2) % NEFCON_OBT - optimizing bound type % NEFCON_OBND - nof steps for rulelearning (bound) % NEFCON_GEN - selected signal generator % NEFCON_CONTR- selected system % NEFCON_GENN - generate noise during rule learening, boolean % NEFCON_ADDR - add rules during optimization, boolean % NEFCON_MFIN - generated nof MF's for input (rule learning) % NEFCON_MFOUT- generated nof MF's for output (rule learning) % NEFCON_MFIT - generated type of MF's for input (rule learning) % NEFCON_MFOT - generated type of MF's for output (rule learning) % NEFCON_RRATE- rule learning rate (bottom up only) % NEFCON_RPER - percentage for rule removing %% See also NEFCON. % Author(s): Andreas Nuernberger, 08/1996% NEFCON_UIH - Handle to nefgui GUI-Tool %global NEFCON_UIH global NEFCON_SYSNO NEFCON_STAT NEFCON_RULE global NEFCON_OPT NEFCON_IFMN NEFCON_EFM NEFCON_EFMN global NEFCON_RATE NEFCON_FERR NEFCON_FIS NEFCON_NUMIN global NEFCON_RBT NEFCON_RBND NEFCON_RBT1 NEFCON_RBND1 NEFCON_OBT NEFCON_OBND global NEFCON_GEN NEFCON_CONTR global NEFCON_RRATE NEFCON_RPER global NEFCON_GENN NEFCON_ADDR NEFCON_MFIN NEFCON_MFOUT NEFCON_MFIT NEFCON_MFOT global NEFCON_SIGNAL RANGE_LIMIT NCD_UB NCD_LB if nargin == 1 % set globals NEFCON_SYSNO = nefmatrix(1,1); NEFCON_STAT = nefmatrix(1,2); NEFCON_RULE = nefmatrix(1,3); NEFCON_OPT = nefmatrix(1,4); NEFCON_FERR = nefmatrix(1,5); NEFCON_RATE = nefmatrix(1,6); NEFCON_NUMIN = nefmatrix(1,7); NEFCON_RBT = nefmatrix(1,8); NEFCON_RBND = nefmatrix(1,9); NEFCON_RBT1 = nefmatrix(1,10); NEFCON_RBND1 = nefmatrix(1,11); NEFCON_OBT = nefmatrix(1,12); NEFCON_OBND = nefmatrix(1,13); NEFCON_GEN = nefmatrix(1,14); NEFCON_CONTR = nefmatrix(1,15); NEFCON_GENN = nefmatrix(1,16); NEFCON_MFIN = nefmatrix(1,17); NEFCON_MFOUT = nefmatrix(1,18); NEFCON_MFIT = nefmatrix(1,19); NEFCON_MFOT = nefmatrix(1,20); NEFCON_ADDR = nefmatrix(1,21); NEFCON_RRATE = nefmatrix(1,22); NEFCON_RPER = nefmatrix(1,23); NEFCON_IFMN = deblank(setstr(nefmatrix(2,:))); NEFCON_EFMN = deblank(setstr(nefmatrix(3,:))); efm_lines = nefmatrix(4,1); fis_lines = nefmatrix(4,2); if efm_lines == 0 NEFCON_EFM = []; else NEFCON_EFM = nefmatrix(5:(4+efm_lines),:); end if fis_lines == 0 NEFCON_FIS = []; else NEFCON_FIS = nefmatrix((5+efm_lines):(4+fis_lines+efm_lines),:); end % if bounded signal generator load bounds and signal if NEFCON_GEN == 2 & size(nefmatrix,1) > 4+fis_lines+efm_lines actl = 5+fis_lines+efm_lines; idxl = actl; RANGE_LIMIT = nefmatrix(actl,1:2); if nefmatrix(idxl,3) ~= 0 NEFCON_SIGNAL = nefmatrix(actl+1:actl+nefmatrix(idxl,3),1:nefmatrix(idxl,4)); actl = actl + nefmatrix(idxl,3); end if nefmatrix(idxl,5) ~= 0 NCD_UB = nefmatrix(actl+1:actl+nefmatrix(idxl,5),1:nefmatrix(idxl,6)); actl = actl + nefmatrix(idxl,5); end if nefmatrix(idxl,7) ~= 0 NCD_LB = nefmatrix(actl+1:actl+nefmatrix(idxl,7),1:nefmatrix(idxl,8)); actl = actl + nefmatrix(idxl,7); end end end if nargout == 1 % get globals and create matrix nefmatout = [NEFCON_SYSNO NEFCON_STAT NEFCON_RULE NEFCON_OPT NEFCON_FERR ... NEFCON_RATE NEFCON_NUMIN NEFCON_RBT NEFCON_RBND NEFCON_RBT1 NEFCON_RBND1 ... NEFCON_OBT NEFCON_OBND NEFCON_GEN NEFCON_CONTR ... NEFCON_GENN NEFCON_MFIN NEFCON_MFOUT NEFCON_MFIT NEFCON_MFOT NEFCON_ADDR ... NEFCON_RRATE NEFCON_RPER]; slen = length(NEFCON_IFMN); nrow = size(nefmatout,2); if slen > nrow nefmatout = [nefmatout zeros(size(nefmatout,1), slen-nrow); NEFCON_IFMN]; else nefmatout = [nefmatout; NEFCON_IFMN zeros(1, nrow-slen)]; end slen = length(NEFCON_EFMN); nrow = size(nefmatout,2); if slen > nrow nefmatout = [nefmatout zeros(size(nefmatout,1), slen-nrow); NEFCON_EFMN]; else nefmatout = [nefmatout; NEFCON_EFMN zeros(1, nrow-slen)]; end nefmatout = [nefmatout; zeros(1, size(nefmatout,2))]; % add 4. row if NEFCON_EFM == [] nefmatout(4,1) = 0; else efm_lines = size(NEFCON_EFM, 1); slen = size(NEFCON_EFM, 2); nefmatout(4,1) = efm_lines; nrow = size(nefmatout,2); if slen > nrow nefmatout = [nefmatout zeros(size(nefmatout,1), slen-nrow); NEFCON_EFM]; else nefmatout = [nefmatout; NEFCON_EFM zeros(efm_lines, nrow-slen)]; end end if NEFCON_FIS == [] nefmatout(4,2) = 0; else fis_lines = size(NEFCON_FIS, 1); slen = size(NEFCON_FIS, 2); nefmatout(4,2) = fis_lines; nrow = size(nefmatout,2); if slen > nrow nefmatout = [nefmatout zeros(size(nefmatout,1), slen-nrow); NEFCON_FIS]; else nefmatout = [nefmatout; NEFCON_FIS zeros(fis_lines, nrow-slen)]; end end nefmatout = [nefmatout; zeros(1, size(nefmatout,2))]; % add empty row if NEFCON_GEN == 2 % if bounded signal generator save bounds and signal actl = size(nefmatout,1); if RANGE_LIMIT ~= [] nefmatout(actl,1) = RANGE_LIMIT(1,1); nefmatout(actl,2) = RANGE_LIMIT(1,2); end if NEFCON_SIGNAL ~= [] fis_lines = size(NEFCON_SIGNAL, 1); slen = size(NEFCON_SIGNAL, 2); nefmatout(actl,3) = fis_lines; nefmatout(actl,4) = slen; nrow = size(nefmatout,2); if slen > nrow nefmatout = [nefmatout zeros(size(nefmatout,1), slen-nrow); NEFCON_SIGNAL]; else nefmatout = [nefmatout; NEFCON_SIGNAL zeros(fis_lines, nrow-slen)]; end end if NCD_UB ~= [] fis_lines = size(NCD_UB, 1); slen = size(NCD_UB, 2); nefmatout(actl,5) = fis_lines; nefmatout(actl,6) = slen; nrow = size(nefmatout,2); if slen > nrow nefmatout = [nefmatout zeros(size(nefmatout,1), slen-nrow); NCD_UB]; else nefmatout = [nefmatout; NCD_UB zeros(fis_lines, nrow-slen)]; end end if NCD_LB ~= [] fis_lines = size(NCD_LB, 1); slen = size(NCD_LB, 2); nefmatout(actl,7) = fis_lines; nefmatout(actl,8) = slen; nrow = size(nefmatout,2); if slen > nrow nefmatout = [nefmatout zeros(size(nefmatout,1), slen-nrow); NCD_LB]; else nefmatout = [nefmatout; NCD_LB zeros(fis_lines, nrow-slen)]; end end end nefmatout = real(nefmatout); % string to numeric end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -