⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 match_type.m

📁 几个关于多小波的程序
💻 M
字号:
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

⌨️ 快捷键说明

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