unsubmatrix.m

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

M
27
字号
function ret = unsubmatrix ( A , o ) # o specifies the columns that were omit.# unsubmatrix puts them back, set to zero. if ((nargin != 2))    usage ("unsubmatrix(A,o)");  endifs = size(A) ; subheight = s(1) ; subwidth = s(2) ; s = size( o ) ; height = s(2) ; width = height ;newl=0;C=zeros(height,width) ;for l=1:height	if ( !o(l) ) 		newl++;		newm=0;		for m =1:width			if ( !o(m) ) 				newm++;				C(l,m)=A(newl,newm);			endif		endfor	endif		endforret = C ;

⌨️ 快捷键说明

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