|
楼主 |
发表于 2006-5-23 15:05
|
显示全部楼层
再次求助!
function y=g(m1,m2)<BR>hold off<BR>syms t<BR>m1=input('the m1 is:')<BR>m2=input('the m2 is:')<BR>i=2*m2+m1;<BR>for t1=0.1<BR> t=0:0.0001:t1;<BR> y=5*rectpuls(t-0.05-0.1*i,0.1);<BR> y1=trapz(t,y);<BR> plot(t,y1,'r');<BR> hold on<BR>end<BR>for t1=0.1 t2=0.2<BR> t=t1:0.0001:t2;<BR> y=5*rectpuls(t-0.05-0.1*i,0.1);<BR> y2=trapz(t,y);<BR> plot(t,y2,'r');<BR> hold on<BR>end<BR>for t2=0.2 t3=0.3<BR> t=t2:0.0001:t3;<BR> y=5*rectpuls(t-0.05-0.1*i,0.1);<BR> y3=trapz(t,y);<BR> plot(t,y3,'r');<BR> hold on<BR>end<BR>for t3=0.3 t4=0.4<BR> t=t3:0.0001:t4;<BR> y=5*rectpuls(t-0.05-0.1*i,0.1);<BR> y4=trapz(t,y);<BR> plot(t,y4,'r');<BR> hold on<BR>end<BR>t=0:0.0001:0.4;<BR>y=5*rectpuls(t-0.05-0.1*i,0.1);<BR>plot(t,y);<BR>hold on;<BR>axis([0,0.4,0,6]);<BR>这是我用matlab编的,怎么用simulink实现.<BR> |
|