亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fpat.m

?? 這個是一個fuzzy patter detector算法工具箱,有例子程序, 請您用winzip解壓縮
?? M
字號:
%--------------------------------------------------------------------------------
% RES = fpat(TMPL,OBJ,'OPT',...,'OPT',...)
%	A fuzzy pattern detector...
%       the only pattern detector you will ever need!
%
% TMPL	: template to search for
%	  - a string		vector/matrix
%	  - a numeric		vector/matrix of any ML data type
% OBJ	: object to be searched
%	  - a cell array of	strings
%	  - a matrix of		strings
%	  - a cell array of	numerics of any ML data type
%	  - a matrix of		numerics of any ML data type
% OPT	: options
% -exact: only return results with   .isexact == true
% -match: only return results with   .ismatch == true
% -nolap: only return results with   .isolap  == false
%		note: these flags are mutually exclusive
%   -mrg: merge .rowbeg/.rowend into .row     =  [.rowbeg;.rowend]
%	  merge .colbeg/.colend into .col     =  [.colbeg;.colend]
%    -ix: change index to any valid ML 'data type'.
%		eg: r = fpat(tmpl,obj,'-ix','uint8');
%     -s: suppress collection of matching tokens
%		note: may help in memory-intensive scans of large OBJs
%
% RES	: structure returning fields for
%	  - search parameters/declarations/template
%	  - summary of matching patterns
%           .isexact: logical 1 = EXACT pattern match with
%				  no intervening characters/numbers
%				  no line/cell wrapping
%				  overlaps are possible
%		      logical 0 = inexact (fuzzy) match
%	    .ismatch: logical 1 = exact match with no intervening elements
%		      logical 0 = inexact (fuzzy) match with intervening elements
%	    .iswrap:  logical 1 = match across lines/cells
%		      logical 0 = match on a single line/cell
%	    .isolap:  logical 1 = this match overlaps previous one
%		      logical 0 = this match does not overlap previous one
%	    .patlen:  length  of match
%	  - row/col   indices of matches
%	  - collected matching patterns
%
% NOTE ON SPACES AND MATCHING STRATEGY:
% Pattern matching is performed by first removing all characters/numbers not in
% the template, then comparing the reminder exactly with the template.
% Thus spaces are significant when TMPL includes at least one space; otherwise,
% they are not.
% For instance, if TMPL = 'B RE', an exact match will be returned from
% OBJ_1 = 'xB xRxE', but NOT from OBJ_2 = 'xB xRx E'.
% In both OBJs, 'x' is removed because it is not in TMPL, leaving OBJ_1 = 'B RE'
% and OBJ_2 = 'B R E'.
% But if TMPL = 'BRE' (with no space), spaces are discarded in the search,
% leaving OBJ_1 = 'BRE' and OBJ_2 = 'BRE', both of which return exact matches.
%
% USAGE EXAMPLES:
%
%	x = {	'a good BRETT'
%		'a bad BrrrRETt'
%		'a wide B R E T T'
%		'a shaky B RET  T'
%		'a noisy bbB rRxy EeTTtTt'
%		'a wrapped BR'
%		'ET      '
%		'T'};
%
%	tmpl =		'BRETT'			'B RE'		  'B R E'
%	-----------------------------------------------------------------
%	res=fpat(tmpl,x)
%	OUTPUT:
%	isexact: 	[1 0 0 0 0]		  1		   [1 0]
%	ismatch:	[1 0 0 0 0]		  1		   [1 0]
%	iswrap: 	[0 0 0 0 1]		  0		   [0 0]
%	isolap: 	[0 0 0 0 0]		  0		   [0 0]
%	patlen: 	[5 9 8 11 11]		  4		   [5 8]
%	rowbeg: 	[1 3 4 5 6]		  4		   [3 5]
%	rowend: 	[1 3 4 5 8]		  4		   [3 5]
%	colbeg: 	[8 8 9 11 11]		  9		   [8 11]
%	colend: 	[12 16 16 21 1]		 12		   [12 18]
%
%	x = [1 2 3 4; 3 4 pi 3; 4 3 pi 4; 3 3 pi 4];
%
%	tmpl =		[3 4]			 [3 4 3]	   [3 4 5]
%	------------------------------------------------------------------
%	res=fpat(tmpl,x)
%	OUTPUT:
%	isexact:	[1 1 0 0 0]		 [0 0 0 0]
%	ismatch:	[1 1 1 0 0]		 [1 0 1 0]
%	iswrap:		[0 0 1 0 0]		 [1 0 1 1]
%	isolap: 	[0 0 0 0 0]		 [0 1 1 1]
%	patlen:		[2 2 2 3 3]		 [3 4 3 4]
%	rowbeg:		[1 2 2 3 4]		 [1 2 2 3]
%	rowend:		[1 2 3 3 4]		 [2 2 3 4]
%	colbeg:		[3 1 4 2 2]		 [3 1 4 2]
%	colend:		[4 2 1 4 4]		 [1 4 2 1]

% created:
%	us  urs schwarz		30-Sep-2004	us@neurol.unizh.ch
%	bs  brett shoelson	30-Sep-2004	shoelson@helix.nih.gov
%	sa  steve amphlett	30-Sep-2004	steve.amphlett@ricardo.com
% modified:
%	us			25-Oct-2004 20:49:37

function	p=fpat(varargin)
%--------------------------------------------------------------------------------
% initialize parameter structure
		p=ini_par(varargin{:});
%--------------------------------------------------------------------------------
% arg check
	if	nargin < 2
		help(mfilename);
		return;
	else
		tmpl=varargin{1};
		obj=varargin{2};
	end

%--------------------------------------------------------------------------------
% search for suitable <nan>
		p.runtime=clock;		% start timing
		[tmpl,tnan,ct]=find_nan(tmpl);
		co=class(obj);
		osiz=size(obj);
%--------------------------------------------------------------------------------
% create search string
	switch	co
	case	'cell'
		obj=obj(:);
		l=cellfun('length',obj).';
		ls=mk_int(p,[0 cumsum(l)]);	% R13.x!
%% note
%% in R14 <mk_int> could be replaced nicely by this construct:
%%		ls=p.par.iclass([0 cumsum(l)]);	% R14
		s=tnan(ones(1,ls(end)));
	for	i=1:length(l)
		ix=[ls(i)+1:ls(i+1)];
		s(ix)=obj{i};
	end
	otherwise
		l=repmat(osiz(2),1,osiz(1));
		ls=mk_int(p,[0 cumsum(l)]);
		s=reshape(obj.',1,[]);
	end
		clear l obj;			% save memory
		cs=class(s);
%--------------------------------------------------------------------------------
% find fuzzy pattern
	if	~isempty(tnan)
		sp=tnan(ones(1,ls(end)));
	for	i=tmpl
		sp(s==i)=i;
	end
		nix=sp==tnan;
		sp(nix)='';
	else
		nix=zeros(1,length(s));
		sp=s;
	end
		ip=mk_int(p,strfind(sp,tmpl));
	if	~isempty(ip)
		io=mk_int(p,find(~nix));
		pb=io(ip);
		pe=io(ip+length(tmpl)-1);
		[dum,rb]=histc(double(pb)-.5,ls);
		rb=mk_int(p,rb);
		[dum,re]=histc(double(pe)-.5,ls);
		clear dum;
		re=mk_int(p,re);
		p.runtime=etime(clock,p.runtime);% end timing
%--------------------------------------------------------------------------------
% create output structure
		p.par.template=tmpl;
		p.par.tclass=ct;
		p.par.tlen=length(tmpl);
		p.par.tnan=tnan;
		p.par.oclass=co;
		p.par.osize=osiz;
		p.par.sclass=cs;
		p.par.ssize=size(s);
		p.isexact=[];			% keep this logic!
		p.ismatch=[];
		p.iswrap=rb~=re;
		p.isolap=[false pb(2:end)<=pe(1:end-1)];
		p.patlen=pe-pb+1;
		p.ismatch=p.patlen==length(tmpl);
		p.isexact=logical(p.ismatch.*~p.iswrap);
% user wants a subset
		ix=[];
	if	p.par.exactflg
		ix=p.isexact;
		p.par.matchflg=false;		% keep this logic!
		p.par.nolapflg=false;
		p.mode='ISEXACT patterns only';
	elseif	p.par.matchflg
		ix=p.ismatch;
		p.par.nolapflg=false;
		p.mode='ISMATCH patterns only';
	elseif	p.par.nolapflg
		ix=~p.isolap;
		p.mode='NOT OVERLAPPING patterns only';
	end
	if	~isempty(ix)
		p.isexact=p.isexact(ix);
		p.ismatch=p.ismatch(ix);
		p.iswrap=p.iswrap(ix);
		p.isolap=p.isolap(ix);
		p.patlen=p.patlen(ix);
		rb=rb(ix);
		re=re(ix);
		pb=pb(ix);
		pe=pe(ix);
	end
		p.npat=length(rb);
% user wants to merge row/col vecs
	if	p.par.mrgflg
		p.row=[rb;re];
		p.col=[pb-ls(rb);pe-ls(re)];
	else
		p.rowbeg=rb;
		p.rowend=re;
		p.colbeg=pb-ls(rb);
		p.colend=pe-ls(re);
	end
% user wants matching tokens
		p.matches=[];
	if	~p.par.sflg
	for	i=1:p.npat
		p.matches{i,1}=s(pb(i):pe(i));
	end
	end
	else	% pattern not found
		p.runtime=etime(clock,p.runtime);
	end	% pattern found?
		return;
%--------------------------------------------------------------------------------
function	p=ini_par(varargin)

% declarations/options
		p=[];
		p.magic='FPAT';
		p.ver='25-Oct-2004 20:49:37';
		p.time=datestr(clock);
		p.runtime=0;
		p.par.mos=version;		% ML version
		p.par.rel=sscanf(version('-release'),'%d');
		p.par.exactflg=false;		% opt: only use  .isexact
		p.par.matchflg=false;		% opt: only use  .ismatch
		p.par.nolapflg=false;		% opt: only use ~.isoap
		p.par.mrgflg=false;		% opt: merge inx
		p.par.ixflg=false;		% opt: change def index type
		p.par.sflg=false;		% opt: supress token retrieval
		p.par.iclass=@double;		% def index type cast
	if	p.par.rel >= 14
		p.par.iclass=@double;		% speed
		p.par.iclass=@uint32;		% size
	end
		p.mode='ALL patterns';
		p.npat=0;

% option parser
	for	i=3:nargin
	switch	varargin{i}
	case	'-exact'
		p.par.exactflg=true;
	case	'-match'
		p.par.matchflg=true;
	case	'-nolap'
		p.par.nolapflg=true;
	case	'-mrg'
		p.par.mrgflg=true;
	case	'-s'
		p.par.sflg=true;
	case	'-ix'
		t=varargin{i+1};
	if	p.par.rel >= 14
		p.par.ixflg=true;
		p.par.iclass=str2func(t);
	else
		txt=sprintf('fpat> R%d: cannot typecast index vectors to <%s>',p.par.rel,t);
		txt=str2mat(txt,sprintf('fpat> using default <double>'));
		disp(txt)
	end
	end
	end
		return;
%--------------------------------------------------------------------------------
function	[tmpl,tnan,ct]=find_nan(tmpl)

% we must search for a UNIQUE nan-marker!
% we do not use <nan>s, they are slow

		dtyp={'single','double'};	% double types
		tnan=[];
		tmpl=reshape(tmpl.',1,[]);
	if	islogical(tmpl)			% type logical
		tmpl=uint8(tmpl);
	end
		ct=class(tmpl);
% ... hopefully statistics will beat the odds!
	if	isempty(find(strcmp(ct,dtyp)))	% type ~double
		umax=max(double(tmpl))+1;
		tnan=umax;
	for	i=0:umax
	if	isempty(find(tmpl==i))
		tnan=i;
		break;
	end
	end
% ...check for data type overflow!
	if	tnan == umax && feval(ct,tnan) ~= umax
		tnan=[];
	end
	else					% type double
		tnan=unique(tmpl);		% well
		tnan=tnan(tnan==tnan & ~isinf(tnan));
	if	~isempty(tnan)
	if	length(tnan) > 1
		tnan=mean(tnan(1:2));
	else
		tnan=(tnan==0)+.5*tnan;		% take care of zeros
	end
	end
	end
	if	~isempty(tnan)
		tnan=feval(ct,tnan);		% R13.x!
	end
		return;
%--------------------------------------------------------------------------------
function	b=mk_int(p,b)

% note
% this function is necessary due to fnc-handle incompatibility
% between R13.x / R14
% once everybody has switched to R14, we'll get rid of it

	if	p.par.rel == 14
		b=p.par.iclass(b);
	end
		return;
%--------------------------------------------------------------------------------

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91福利视频网站| 久久精品国产99国产| 精品一区二区三区不卡 | 亚洲色图制服丝袜| 欧美一级夜夜爽| 91激情五月电影| 欧美性猛交xxxx乱大交退制版| 国产99久久久久久免费看农村| 激情综合五月婷婷| 激情另类小说区图片区视频区| 久久99精品久久只有精品| 午夜精品久久久久久久久| 亚洲二区视频在线| 蜜臀av在线播放一区二区三区| 日韩黄色免费电影| 国产一区二区三区免费看| 国产精品中文有码| av午夜精品一区二区三区| 在线免费亚洲电影| 欧美一级片在线看| 国产欧美视频在线观看| 中文字幕在线不卡视频| 亚洲主播在线播放| 黄色成人免费在线| 99国产精品久久久| 日韩一区二区三区视频| 久久蜜臀中文字幕| 亚洲午夜av在线| 国产一区二区三区综合| 91一区一区三区| 91精品在线免费| 国产人成亚洲第一网站在线播放| 最新国产精品久久精品| 亚洲一区二区三区三| 久久成人久久爱| 欧美影院午夜播放| 亚洲国产高清在线观看视频| 亚洲国产sm捆绑调教视频| 国产成人免费在线视频| 91高清视频在线| 国产一区二区h| 色狠狠av一区二区三区| 欧美一区二区三区影视| 日本一二三四高清不卡| 日韩av一二三| 色婷婷av久久久久久久| 久久久蜜臀国产一区二区| 亚洲高清久久久| 91蜜桃在线观看| 国产欧美一区二区三区鸳鸯浴 | 国产亚洲欧美色| 午夜一区二区三区在线观看| 成人白浆超碰人人人人| 精品黑人一区二区三区久久| 亚洲国产综合在线| 91伊人久久大香线蕉| 国产蜜臀97一区二区三区| 欧美aaaaa成人免费观看视频| 97成人超碰视| 2024国产精品视频| 久久国产福利国产秒拍| 欧美精选一区二区| 亚洲一区二区三区四区在线观看 | 综合精品久久久| 国产精品一区2区| 日韩女优av电影| 亚瑟在线精品视频| 91搞黄在线观看| 亚洲精品日产精品乱码不卡| 国产不卡免费视频| 日韩三级伦理片妻子的秘密按摩| 亚洲一区二区三区在线播放 | 亚洲伦理在线免费看| 成人精品视频一区| 欧美韩国日本不卡| 国产凹凸在线观看一区二区 | 99精品久久99久久久久| 欧美国产日本韩| www.亚洲在线| 亚洲综合一区二区| 欧美三级电影在线看| 视频一区二区三区中文字幕| 欧美日本国产视频| 美女高潮久久久| 久久综合九色综合久久久精品综合| 轻轻草成人在线| 久久综合狠狠综合久久综合88| 国产乱人伦精品一区二区在线观看 | 国产一区二区不卡老阿姨| 久久久蜜臀国产一区二区| 成人高清视频在线| 亚洲黄色尤物视频| 欧美精品丝袜久久久中文字幕| 视频一区在线视频| 久久久久久夜精品精品免费| 不卡一区二区三区四区| 亚洲影视在线播放| 日韩片之四级片| 成人av在线一区二区| 综合av第一页| 欧美日韩精品免费| 国产一区二区三区综合| 亚洲精品免费播放| 日韩午夜在线观看| heyzo一本久久综合| 午夜精品影院在线观看| 久久久精品黄色| 在线观看日韩av先锋影音电影院| 日韩电影在线免费| 日本一区二区视频在线| 欧美美女直播网站| 国产成a人无v码亚洲福利| 亚洲国产精品天堂| 国产三区在线成人av| 欧美日韩日本视频| 不卡视频在线观看| 蜜臀av一级做a爰片久久| 综合久久给合久久狠狠狠97色| 91精品国产麻豆| 91麻豆国产香蕉久久精品| 日韩avvvv在线播放| 中文字幕一区二区三区精华液| 欧美一区二区三区系列电影| 豆国产96在线|亚洲| 日韩在线一区二区三区| 亚洲视频小说图片| 国产欧美日产一区| 日韩久久精品一区| 欧美日韩另类一区| 色系网站成人免费| 处破女av一区二区| 韩日欧美一区二区三区| 日本中文字幕一区二区有限公司| 亚洲视频 欧洲视频| 久久久久国产成人精品亚洲午夜 | 日韩主播视频在线| 亚洲色图清纯唯美| 国产精品乱人伦一区二区| 欧美大片国产精品| 宅男噜噜噜66一区二区66| av午夜精品一区二区三区| 国产精品996| 国产精品一二三四五| 日本成人在线电影网| 亚洲电影一区二区| 亚洲一区在线观看视频| 国产精品久久一卡二卡| 欧美激情综合五月色丁香| 久久久久99精品一区| 国产亚洲成年网址在线观看| 久久只精品国产| 久久免费电影网| 中文幕一区二区三区久久蜜桃| 亚洲精品在线网站| 久久综合久久鬼色| 国产亚洲综合在线| 国产欧美一区在线| 中文字幕欧美区| 亚洲同性gay激情无套| 日韩一区中文字幕| 夜夜亚洲天天久久| 五月婷婷综合在线| 国产精品久久久久久久久搜平片 | 亚洲午夜久久久久久久久电影网 | 91精品在线免费| 日韩欧美国产综合一区| 精品噜噜噜噜久久久久久久久试看| 日韩一区二区三区电影在线观看 | 亚洲国产日韩av| 日本不卡视频一二三区| 男男成人高潮片免费网站| 久久亚洲捆绑美女| 国产精品一区二区三区99 | 精品国产91洋老外米糕| 日韩免费观看高清完整版在线观看| 精品国产免费一区二区三区香蕉| 欧美大片在线观看| 国产午夜精品福利| 自拍偷拍欧美激情| 亚洲一区二区三区三| 日本va欧美va瓶| 国产福利91精品一区| 91在线播放网址| 91精品蜜臀在线一区尤物| 久久久91精品国产一区二区精品| 亚洲天堂成人网| 精品一区二区三区视频| 99久久精品免费看国产免费软件| 欧美狂野另类xxxxoooo| 日本一区二区视频在线| 视频一区二区国产| 菠萝蜜视频在线观看一区| 欧美另类变人与禽xxxxx| 国产精品麻豆99久久久久久| 日韩av电影一区| 日本精品视频一区二区三区| 久久久久久久久久久久久女国产乱 | 91久久久免费一区二区| 精品少妇一区二区三区视频免付费 | 美国毛片一区二区|