- 6
- 0
- 约3.18千字
- 约 5页
- 2018-05-18 发布于河南
- 举报
信号与系统实验参考程序
实验一:
内容1
A=ones(3,2)
B=zeros(3,2)
C=rand(3,2)
D=randn(3,2)
E=eye(3)
内容2
x=input(x=) [y,z]=qiuhe(x); %函数见qiuhe.m
fprintf(N个数总和为),y fprintf(N个数平均为),z
函数求和
function [y,z] = qiuhe(x)
[m,n]=size(x);
if m == 1 M=n; end
y = sum(x); z = sum(x)/n;
内容3
t=0:0.1:30; y1=sin(t); y2=exp(-0.1.*t).*sin(t+1);
subplot(2,1,1),plot(t,y1),grid
subplot(2,1,2),plot(t,y2),grid
实验二:
内容1
%产生单位冲激信号
clear all;t0=0;t1=1;dt=0.05;
t=0:0.05:5;st=length(t);
n1=floor((t1-t0)/dt);
x1=zeros(1,st);
x1(n1)=1/dt;
subplot(4,1,1),stairs(t-0.95,x1),grid
axis([-1,4,-1,22])
%产生单位阶跃信号
x2=[zeros(1,n1-1),ones(1,st-n1+1)];
subplo
原创力文档

文档评论(0)