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

📄 expme.m

📁 数字通信第四版原书的例程
💻 M
字号:
function [A2,A1,B1] = expme(v,d,h)
%EXPME	Used by LINSIM to calculate matrix exponentials.
%       This function calculates matrix exponentials using eigenvalue
%	decomposition for the special case when the A matrix is
%	singular.  It is not used when A has repeated eigenvalues.

%	Copyright (c) 1990-94 by The MathWorks, Inc.
%	Andrew Grace 11-12-90.
[n,dum] = size(v);
invv = inv(v);
d  = diag(d).';
de = exp(d*h);
A2 = real(v .* de(ones(n,1),:) *invv).';

[ind]  = find((abs(d)<1e-8));
on = ones(length(ind),1);
d(ind) = on;

d2 = (de - ones(1,n))./d;
d2(ind) = h*on;
A1 = real(v .*  d2(ones(n,1),:) * invv).';

d(ind) = on;
d3 = (d2 - h*ones(1,n))./d;
d3(ind) = h*h*0.5*on;
B1 = real(v .*  d3(ones(n,1),:) * invv).';

⌨️ 快捷键说明

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