How can I repeat the pulse after some period of time?

I have generated a pulse by combining a rising exponential and falling exponential signal. Rising exponential lasts for 30 ns followed by a falling exponential which lasts for 500 ns. This pulse has then to be repeated after every 200 ms. How can I do it?

 Accepted Answer

you can use repmat function

4 Comments

This is my code :
a1=0.19085;
t1=-30:0.01:0;
y1=exp(a1*t1);
a2=-0.006216;
t2=0:0.01:500;
y2=exp(a2*t2);
t3 = [t1 t2];
y3 = [y1 y2];
plot(t3,y3);
y3 has to be repeated. Can you tell me how exactly can I use repmat in this case?
a1=0.19085;
t1=-30:0.01:0;
y1=exp(a1*t1);
a2=-0.006216;
t2=0:0.01:500;
y2=exp(a2*t2);
tt=t2(end);
t4=tt+0.01:0.01:tt+200
t3 = [t1 t2 t4 ];
y3 = [y1 y2 zeros(1,numel(t4)) ];
n=8
new_y3=repmat(y3,1,n)
new_t3=-30:0.01:numel(new_y3)*0.01-0.01
plot(new_t3,new_y3);

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!