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.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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;
0 commentaires
Réponse acceptée
Paul
le 29 Mar 2022
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Filter Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!