matlab code for generating triangular wave

I have to generate a matlab code for generating triangular wave with monotonically increasing and monotonically decreasing amplitude. That means the triangle should go on reduce its size with increasing time. plz can any one help me in this regard
Thanking you

 采纳的回答

Image Analyst
Image Analyst 2013-12-24
编辑:Image Analyst 2013-12-24
See attached demo, below in blue. Feel free to adapt as needed. The Signal Processing Toolbox has a built in triangle wave function called sawtooth() if you'd rather use that. Search the tags for triangle if you want more info.

3 个评论

sir thank u very much. Actually i am new to matlab. Sir i have attached the triangular waveform fie in word format which i actually needed to be obtained by writing code in matlab. plz refer attached file. plz help me in this regard.
thank you
The waveform obtained from this code the amplitude is constant. But i want my amplitude to be continously decreasing above and continously increasing at below of the peak. i.e. example: above 7.5,6.5, 5.5 and so on below it should start from zero and then should increase -1 -2 and so on plz help me
You didn't attach anything. If you need to pull the text out of Microsoft Word, you're going to have to use ActiveX programming. Search this forum for examples.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by