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

📄 rdivide.m

📁 几个关于多小波的程序
💻 M
字号:
function Q = rdivide(P1,P2)

% RDIVIDE -- elementwise right division of matrix polynomials
%
%        Q = P1 ./ P2
%        Q = rdivide(P1,P2)
%
% This function is not meant to be called by the user. It is called by
% Matlab if an expression of the form P1./P2 is encountered, where at
% least one of the two operands is a matrix polynomial. The effect is
%
%        Q  = P1  ./ P2   if P2 is a regular matrix
%         k     k
%
%        Q  = P1 ./ P2    if P1 is a regular matrix
%         k           k
%
%        Q  = P1  ./ P2   if P1, P2 are both matrix polynomials
%         k     k      k
%
% I am not sure if this routine has any useful applications, but I
% wrote it for completeness.

% 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

if (isa(P1,'mpoly'))
    if (isa(P2,'mpoly'))
	Q = trim(P1);
	P1max = get(Q,'max');
	P2 = trim(P2,[P1.min,P1max]);
	n = size(Q.coef);
% this reshape business is necessary for symbolic matrix polynomials
	Q.coef = reshape(Q.coef(:) ./ P2.coef(:),n);
    else 
% P2 is a matrix, not a matrix polynomial
	Q = trim(P1);
	if (isa(P2,'sym') & ~isa(Q.coef,'sym'))
	    Q = sym(Q);
	end
	for k = 1:size(Q.coef,3)
%	    Q{k} = P1{k} ./ P2;
	    Q.coef(:,:,k) = P1.coef(:,:,k) ./ P2;
	end
    end
else
% P1 is a matrix, not a matrix polynomial
    Q = trim(P2);
    if (isa(P1,'sym') & ~isa(Q.coef,'sym'))
	Q = sym(Q);
    end
    for k = 1:size(Q.coef,3)
%	Q{k} = P1 ./ P2{k};
	Q.coef(:,:,k) = P1 ./ P2.coef(:,:,k);
    end
end

[type,m,r] = match_type(P1,P2);
Q = set(Q,'type',type,'m',m,'r',r);

⌨️ 快捷键说明

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