Step Fucntion in Matlab

3 次查看(过去 30 天)
I am new to matlab and I have to plot this step fucntion but I don't even know where to start.
x(t) = u(t + 1) − 3u(t) + 2u(t−3) with a time interval of -2: 0.1: 2. May I please get some help? The hint was to use heaviside.

采纳的回答

Star Strider
Star Strider 2019-2-16
Since the unit step functrion is defined as being equal to 1 for , I would use:
Ustp0 = @(t) (t >= 0);
Ustp1 = @(t) 0.5*(t == 0) + 1*(t > 0); % ‘Half-Maximum’ Convention
Plotting the unit step funcitons themselves:
t = -2: 0.1: 2;
figure
subplot(2,1,1)
plot(t, Ustp0(t))
ylim([-0.1 1.1])
subplot(2,1,2)
plot(t, Ustp1(t))
ylim([-0.1 1.1])
So use those to create your function, and and go from there.
I leave the rest to you.

更多回答(0 个)

类别

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

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by