Remove offset and delay of step response

9 次查看(过去 30 天)
I need to remove the offsets and delays of the step response from the code below so that the step response starts at t = 0s. I've attached a photo of the figure for further explanation. Does anyone have any suggestions on how I would do that?
% Creating a plot to show step input and step response
figure
x = T(:, 1); % Time (s)
y = T(:, 2); % Channel 1 - step input
plot(x,y)
hold on
yn_random = T(:, 3); % Channel 2 - step response
plot(x, yn_random);
title('Open Loop Step Response');
xlabel('t (s)')
ylabel('V_p (v)')
legend('2V Step Input','Step Response')
hold off

回答(1 个)

Sulaymon Eshkabilov
(1) Start at t=0:
...
N = numel(x);
x = linspace(0, 5, N);
(2) Remove the offset:
yoff=0.5;
y = T(:, 2)-yoff; % Channel 1 - step input
...

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by