?? 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 + -