필터 지우기
필터 지우기

How could I do a summation of (y) so I can create a signal that goes from 0 to 30 sec repeating (y) every 3 seconds in a graph.

조회 수: 2 (최근 30일)
A = 1.15;
t = linspace(-2, 1, 1000);
a = exp(-0.5*t);
y = A*a.*(sin(2*pi*3*t)) .* (ustep(t+2)-ustep(t));
figure
plot(t, y, 'LineWidth', 2)
xlabel('t');
ylabel('y');
title('L2E2');
grid on;

채택된 답변

Paul
Paul 2022년 3월 29일
Maybe this is the goal? Note that I modified the definition of y to make it in line with what I assumed the question means.
A = 1.15;
a = @(t) exp(-0.5*t);
ustep = @(t) t>=0;
y = @(t) A*a(t).*(sin(2*pi*3*t)) .* (ustep(t) - ustep(t-2)); % changed from original code
t = -3:.01:3;
figure;
plot(t,y(t))
t = 0:.01:30;
plot(t,y(mod(t,3)))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by