abc.m

来自「example of a 7 pulse multiple pulse widt」· M 代码 · 共 27 行

M
27
字号
clear all;
tow = input('Input the value of tow=')
pulse = input('Input the number of pulses=')
pn=pulse-1;
pw=120/pn;
ton=tow*pw;
toff=pw*(1-tow);
start=30;
a(1)=start
a(2)=start+(ton/2);
i=2;
for i=2:2:((2*pn))
    a(i+1)=a(i)+toff;
    a(i+2)=a(i+1)+ton;
end
a(i+1)=a(i)+(toff);
a(i+2)=a(i+1)+(ton/2);
j=i+3;
start1=210;
a(j)=start1+(ton/2);
for k=j:2:(j+(2*pn)-1)
    a(k+1)=a(k)+toff;
    a(k+2)=a(k+1)+ton;
end
a(k+2)=a(k+1)+(ton/2);
a
b=a*(0.01/180)

⌨️ 快捷键说明

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