how to generate triangular wave form ?

1 回表示 (過去 30 日間)
ajeet verma
ajeet verma 2017 年 8 月 2 日
編集済み: Geoff Hayes 2017 年 8 月 2 日
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

回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by