Hello: i want to give a step input to my simulink function which starts at 1 second and ends at 1.1 seconds and having an amplitude of 0.1. Step block not working

조회 수: 99 (최근 30일)
which block to be used for giving input to a function with a delay of few seconds, as step input block in sources is not giving the delay

채택된 답변

Paul
Paul 2023년 7월 29일
편집: Paul 2023년 7월 29일
Try using the Waveform Generator block with Waveform Definition parameter set to pulse with appropriate parameters. However, the Waveform Generator block does not accept a continuous sample time.
If you need the pulse to have continuous sample time, then you can use two step blocks. Set the 'Final value' of each to 0.1. Set the start time of the first to 1. Set the start time of the second to 1.1. Use a Subtract block to subtract the second from the first. The output of the Subtract should be the desired rectangular pulse.

추가 답변 (1개)

Sam Chak
Sam Chak 2023년 7월 29일
편집: Sam Chak 2023년 7월 29일
Hi @John,
Mathematically, the functions looks like this:
where a is the amplitude. So, you just need to construct the blocks accordingly.
Edit: Like what @Paul described the steps above, now you can visualize how the function is mathematically constructed.
t = linspace(0, 2, 20001);
a = 0.1; % amplitude
ton = 1.0; % on time
toff = 1.1; % off time
s1 = heaviside(t - ton);
s2 = heaviside(t - toff);
p = a*(s1 - s2);
subplot(311)
plot(t, s1, 'linewidth', 3, 'color', '#7c98c3'), grid on, ylim([-0.50 1.50]), ylabel('s_{1}')
subplot(312)
plot(t, s2, 'linewidth', 3, 'color', '#e5ab45'), grid on, ylim([-0.50 1.50]), ylabel('s_{2}')
subplot(313)
plot(t, p, 'linewidth', 3, 'color', '#abc564'), grid on, ylim([-0.05 0.15]), ylabel('p'), xlabel('t')

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by