📄 bodedb.m
字号:
function [mag_db,phase,w1] = bodedb(G,w)
% function to compute the magnitude (in dB) and phase of the
% frequency response of a single-input, single-output
% lti system object G. The outputs mag and phase
% are regular arrays. This function requires the
% function bode.
%
% inputs - G - LTI system object
% w - frequency array
% output - mag - magnitude in dB
% phase - phase in degrees
% w1 - frequency array
%%%%%%%%%%%%%%%%%%%% bodedb.m %%%%%%%%%%%%%%%%%%%
% Discrete-Time Control Problems using %
% MATLAB and the Control System Toolbox %
% by J.H. Chow, D.K. Frederick, & N.W. Chbat %
% Brooks/Cole Publishing Company %
% September 2002 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if nargin == 1
[mag_ratio,phase,w1] = bode(G);
else
[mag_ratio,phase,w1] = bode(G,w);
end
%---- convert magnitude to dB & remove singleton dimension
mag_db = squeeze(20*log10(mag_ratio));
phase = squeeze(phase); % remove singleton phase dimension
%%%%%%%%%%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -