suboffmatrix.m

来自「这是用matlab编写的支持向量机的函数工具箱」· M 代码 · 共 24 行

M
24
字号
function ret = suboffmatrix ( A , o ) # o specifies the columns to omit.# suboffmatrix returns the offdiagonal entries corresponding to the # interactions between omitted and non-omitted dudes. if ((nargin != 2))    usage ("suboffmatrix(A,o)");  endifs = size(A) ; height = s(1) ; width = s(2) ; newl=0;for l=1:height	if ( o(l) ) 		newl++;		newm=0;		for m =1:width			if ( !o(m) ) 				newm++;				C(newl,newm)=A(l,m);			endif		endfor	endif		endforret = C ;

⌨️ 快捷键说明

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