Clear Filters
Clear Filters

how to generate triangular wave form ?

3 views (last 30 days)
ajeet verma
ajeet verma on 2 Aug 2017
Edited: Geoff Hayes on 2 Aug 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

Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!