How to generate one square pulse?

36 次查看(过去 30 天)
Moamen Keshk
Moamen Keshk 2020-11-23
回答: Star Strider 2020-11-23
How to generate one square pulse like this one in the picture, where I need to save the pulse in an array

回答(1 个)

Star Strider
Star Strider 2020-11-23
Try this:
sqpuls = @(t,t1,t2) (t>= t1) & (t <= t2);
t = linspace(-1, 1);
figure
plot(t, sqpuls(t, -0.5, 0.5), '-r')
grid
ylim(ylim*1.1)
Experiment to get the result you want.

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by