How can I create an impulse wave via triangular pulse
Afficher commentaires plus anciens
I need to create an impulse wave, through a triangular pulse. I succeded that with the rectangular, but the triangular doesn't seem to work for me.
body of my code:
syms a;
a=0.1;
t=linspace(-0.2,0.2,1000000);
y=zeros(1,1000000);
x=abs(t);
y(x<a)=(1/a)*(1-x);
plot(t,y);
grid;
The error matlab shows me is:
Unable to perform assignment because the left and right sides have a different number of elements.
Error in rectangular_pulse (line 133) (the file name is rectangular pulse)
y(x<a)=(1/a)*(1-x);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!