how to generate triangular wave form ?

1 visualización (últimos 30 días)
ajeet verma
ajeet verma el 2 de Ag. de 2017
Editada: Geoff Hayes el 2 de Ag. de 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

Respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by