多小波处理包。对于多小波的使用很有帮助。

源代码在线查看: match_type.m

软件大小: 460 K
上传用户: tiantianyuehui
关键词:
下载地址: 免注册下载 普通下载 VIP

相关代码

				function [type,m,r] = match_type(varargin)
				
				% MATCH_TYPE - propagate type, dilation factor, multiplicity
				%
				%        [type,m,r] = match_type(P1,P2,P3,...)
				%
				% This is used only in multiwavelet calculations.
				%
				% If one or more of the input arguments have matching type, m, r, 
				% and the rest have no type, return the matching values.
				% If there is a mismatch, or none of the arguments has a type, 
				% return type='', m=0, r=0
				%
				% This is used to assign the correct type to the result of a
				% calculation, such as a matrix product.
				% For example, a symbol matrix times a non-typed matrix returns
				% type 'symbol'. A symbol matrix times a polyphase matrix 
				% returns type ''.
				%
				% This routine is not meant to be called by the user. It is called
				% from inside the basic arithmetic routines.
				
				% Copyright (c) 2004 by Fritz Keinert (keinert@iastate.edu),
				% Dept. of Mathematics, Iowa State University, Ames, IA 50011.
				% This software may be freely used and distributed for non-commercial
				% purposes, provided this copyright statement is preserved, and
				% appropriate credit for its use is given.
				%
				% Last update: Feb 20, 2004
				
				type = '';
				m = 0;
				r = 0;
				
				for i=1:nargin
				% we can ignore any standard matrices mixed in with the arguments
				    if isa(varargin{i},'mpoly')
				
				% check type
					if ~strcmp(varargin{i}.type,'')
					    if strcmp(type,'')
				% first nonempty type found
						type = varargin{i}.type;
					    elseif ~strcmp(type, varargin{i}.type)
				% mismatch
						type = '';
						m = 0;
						r = 0;
						return
					    end
					end
					
				% check dilation factor
					if (varargin{i}.m ~= 0)
					    if (m == 0)
				% first nonempty dilation factor found
						m = varargin{i}.m;
					    elseif (m ~= varargin{i}.m)
				% mismatch
						type = '';
						m = 0;
						r = 0;
						return
					    end
					end
					
				% check multiplicity
					if (varargin{i}.r ~= 0)
					    if (r == 0)
				% first nonempty dilation factor found
						r = varargin{i}.r;
					    elseif (r ~= varargin{i}.r)
				% mismatch
						type = '';
						m = 0;
						r = 0;
						return
					    end
					end
				    end
				end
							

相关资源