Effacer les filtres
Effacer les filtres

how to generate triangular wave form ?

3 vues (au cours des 30 derniers jours)
ajeet verma
ajeet verma le 2 Août 2017
Modifié(e) : Geoff Hayes le 2 Août 2017
i need triangular wave form using given equation in attached file, i am trying but something being wrong, please help my code is ::
clc;
clear all;
%triangular wave form
Imax=0.8;
Imin=0.2;
Im=Imax-Imin;
T = 20;
s = @(x) ((2*Im*x/T)+Imin+Im/2).*(0<=x & x<=T/4) - ((2*Im*x/T)+Imin+3*Im/2).*(T/4<=x & x<=3*T/4)+((2*Im*x/T)+Imin-3*Im/2).*(3*T/4<=x & x<=T);
x = linspace(0, 20);
X = repmat(x, 1000, 10);
sv = s(x);
figure(2)
plot(x,sv)
hold on
for k1 = 20:20:60
plot((x+k1),sv)
end
hold off
for more detail please find attachment

Réponses (0)

Catégories

En savoir plus sur Image Processing Toolbox 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!

Translated by