フィルターのクリア

how to generate rectangular pulse using rectpuls

3 ビュー (過去 30 日間)
Ali Esmaeilpour
Ali Esmaeilpour 2019 年 10 月 1 日
編集済み: Ali Esmaeilpour 2019 年 10 月 1 日
I got a rectangular pulse and I want to generate it like a function "rectangularpulse" instead of the way it's generated with name "W" in the following code:
T0=0 ;
Tf=20 ;
Ts=0.1 ;
t=T0:Ts:Tf ;
system=tf([1 1],[1 1 2]); % system=(s+1)/(s^2+s+2)
system_dis=c2d(system,Ts) ;
system_dis_ss=ss(system_dis) ;
Am=system_dis_ss.a;
Bm=system_dis_ss.b;
Cm=system_dis_ss.c;
n=size(Am,1); % Number of state variables
Om=zeros(1,n);
A=[Am,Om';Cm*Am,1];
B=[Bm ;Cm*Bm];
C=[Om 1];
Nt=numel(t);
W=[ones(floor(Nt/4),1);2*ones(floor(Nt/4),1);-ones(floor(Nt/4),1);zeros(floor(Nt/4+1),1)];

回答 (0 件)

カテゴリ

Help Center および File ExchangeWaveform Generation についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by