?? 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
%%%%%%%%%%
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -