필터 지우기
필터 지우기

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 CenterFile Exchange에서 Waveform Generation에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by