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

📄 chap1_ex4_1.m

📁 无线通讯系统的matlab仿真程序;主要包括同步
💻 M
字号:
% Chapter 1, Example 4.1
% This m.file computes the numerical values for Table 4.1
% and generates the graph in Figure 4.3

clc; close all; clear all;

dt=0.25;
H0=4;
t(1)=0;
H(1)=H0;
HA(1)=H0;
A=10; R=2; F=5;
fact=1-(dt/(A*R));
tau=A*R;
tfinal=5*tau;
ifinal=round(tfinal/dt);

for i=1:ifinal-1
    HA(i+1)=fact*HA(i)+(dt/A)*F;
    t(i+1)=i*dt;
end % i

ti=linspace(0,tfinal,1000);
Hi=R*F+(H0-R*F)*exp(-ti/tau);

del=ifinal/50;
plot(t(1:del:end),HA(1:del:end),'r.')
axis([0 100 0 11])
hold on
plot(ti,Hi,'k')
xlabel('\itt  \rm(min)','FontSize',11)
ylabel('\itH  \rm(ft)','FontSize',11)
text(40,7,'\itH_{\rmA}(\itn\rm), \itn\rm = 0,8,16,..','FontSize',11)
plot(37,7,'r.')
text(40,6,'\itH\rm(\itt\rm)','FontSize',11) 
plot([35.5 38.5],[6 6],'k')
text(40,3,'\Delta\itt \rm= 0.25 min','FontSize',11)
title('Approximate and Exact Tank Level vs. Time','FontSize',11)

⌨️ 快捷键说明

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