Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
 
 
主题工具 显示模式
旧 2007-06-21, 11:46   #1
arthur.geng
初级会员
 
注册日期: 2007-06-21
帖子: 1
声望力: 0
arthur.geng 正向着好的方向发展
默认 【求助】高手帮忙做个题目

六、七段数码管使用的译码电路
程序如下:
function shumaguan1(n)
n=input('请输入仿真时间:')
a=0.05:0.01:0.45;
A=1.5;
b=0.5;
B=1.05:0.01:1.45;
c=0.5;
C=0.55:0.01:0.95;
g=a;d=a;
G=1;D=0.5;
F=B;E=C;
f=0;e=0;
load answer.mat;
t0=answer(1,1);
t=0;
axis equal;
axis([t0-1,t0+n+1,0,2]);
title('A Digital Display Probe')
hold on;
while t<=n
if answer(2,t+1)~=0
plot(a+t+t0,A,'r-');
end
if answer(3,t+1)~=0
plot(b+t+t0,B,'r-');
end
if answer(4,t+1)~=0
plot(c+t+t0,C,'r-');
end
if answer(5,t+1)~=0
plot(d+t+t0,D,'r-');
end
if answer(6,t+1)~=0
plot(e+t+t0,E,'r-');
end
if answer(7,t+1)~=0
plot(f+t+t0,F,'r-');
end
if answer(8,t+1)~=0
plot(g+t+t0,G,'r-');
end
t=t+1;
end

七段数码管的模拟,首先建立如图示的电路,然后在Combinatorial Logic中输入如下的真值表值,不足处不上6行0即可,将d3,d2,d1,d0的幅度设为1,周期为2,脉宽1,相位延迟-1,抽样时间分别为8,4,2,1。同时将MUX值设为4,将TO File文档指定到answer.mat 将其中的Variable name指定为ans。最后建立一个数码管显示的m文件,内容见下。
arthur.geng 当前离线   回复时引用此帖
 


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



所有时间均为北京时间。现在的时间是 11:08


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.