⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 figure31.m

📁 《嵌入式控制系统及其CC++实现-面向使用Matlab的软件开发者》源码
💻 M
字号:
% Embedded Control Systems in C/C++
% by Jim Ledin
%
% Figure 3.1
% This M-file requires the Control System Toolbox

clear all
close all

% Create a linear system
b = 100;
a = [1 1.8 100];
sys = tf(b, a);

% Compute the magnitude and phase of the response
w = logspace(0, 2, 1000);
[mag, phase, w] = bode(sys, w);
mag = mag(:);
phase = phase(:);

% Plot the magnitude
subplot(211)
semilogx(w, 20*log10(mag), 'k')
grid on
ylabel('Magnitude, dB')

% Plot the phase
subplot(212)
semilogx(w, phase, 'k')
grid on
ylabel('Phase, degrees')
xlabel('Frequency, rad/sec')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -