代碼如下:
P=bodeoptions;
P.Grid='on';
P.XLim={[10 1000000]};%設置橫軸範圍
P.FreqUnits='Hz';%將橫座標單位換位HZ
% P.YLim={[-160 50]};%設置縱軸範圍
num1=[1];
den1=[2*0.3*10e-12 0 2.3e-3 0];
G1=tf(num1,den1);
num1=[1];
den1=[2*0.5*10e-12 0 2.5e-3 0];
G2=tf(num1,den1);
num1=[1];
den1=[2*1*10e-12 0 3e-3 0];
G3=tf(num1,den1);
bode(G1,G2,G3,P)
其中P是bode函數的配置(bodeoptions),在命令窗口輸入ans即可看到默認的bodeoptions參數
G1,G2,G3是我定義的三個傳遞函數
這是默認的>> bodeoptions參數
ans =
FreqUnits: 'rad/s'
FreqScale: 'log'
MagUnits: 'dB'
MagScale: 'linear'
MagVisible: 'on'
MagLowerLimMode: 'auto'
PhaseUnits: 'deg'
PhaseVisible: 'on'
PhaseWrapping: 'off'
PhaseMatching: 'off'
PhaseMatchingFreq: 0
ConfidenceRegionNumberSD: 1
MagLowerLim: -Inf
PhaseMatchingValue: 0
PhaseWrappingBranch: -180
IOGrouping: 'none'
InputLabels: [1×1 struct]
OutputLabels: [1×1 struct]
InputVisible: {'on'}
OutputVisible: {'on'}
Title: [1×1 struct]
XLabel: [1×1 struct]
YLabel: [1×1 struct]
TickLabel: [1×1 struct]
Grid: 'off'
GridColor: [0.1500 0.1500 0.1500]
XLim: {[1 10]}
YLim: {[1 10]}
XLimMode: {'auto'}
YLimMode: {'auto'}