📄 losstest.m
字号:
% MATLAB function losstest.m checks out whether
% or not a Q-port network is lossless. For that
% purpose, the network's Q-by-Q scattering matrix, S,
% must be specified.
% Invocation of function test = losstest(S)
% yields a simple verbal statement about the
% existence or the absence of average power losses
% occurring in the network.
function [test] = losstest(S)
eps = 10^(-13);
Q = length(S);
if inv(S')-conj(S)< eps*ones(Q,Q)
test = 0;
disp('The network is lossless.')
disp('Its scattering matrix S is a unitary matrix.')
else
test = 1;
disp('The network is lossy.')
disp('Its scattering matrix S is non-unitary.')
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -