Generating Triangular wave in simulink

조회 수: 89 (최근 30일)
kash
kash 2012년 10월 7일
답변: Vijay P 2018년 5월 3일
I have sine wave bx is simulink,is there any box for triangular wave available,else please tell how to generate triangular wave in simulink of equal amplitude and time

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 10월 8일
generate your signal in matlab command then use a from workspace block with variable name ty
ts=0.1;
t=-3:ts:3
y=repmat(max(t)-abs(t),1,10)
t=-3:ts:-3+length(y)*ts-ts
ty=[t' y']
  댓글 수: 6
Azzi Abdelmalek
Azzi Abdelmalek 2012년 10월 8일
yes you can
JohnLio
JohnLio 2013년 12월 6일
Azzi Abdelmalek: i didn't get how you did that, can you please elaborate a bit how to and which block i have to use in matlab, and where to put these code, newbie in matlab :|

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Julien
Julien 2012년 10월 7일
편집: Julien 2012년 10월 7일
Hi, the triangle generator does not exist but you can create your own.
My tip is to create a pulse signal (pulse width =50%) and adding a negative offset (typically the half of the amplitude you want).
If you want a triangle signal between [0 1] then you have to set:
pulse amplitude : 4 offset : -2
Then you have a pulse varying between [-2 2] You just have to integrate this signal and you will get a nice triangle signal varying between [0 1] ;)
  댓글 수: 4
Julien
Julien 2012년 10월 8일
Contact me in my personal address then I'll can send you the file
Sara
Sara 2013년 5월 7일
how can i get a triangular wave varying from -ve value to a +ve value??

댓글을 달려면 로그인하십시오.


Julien
Julien 2012년 10월 8일
  댓글 수: 10
kash
kash 2012년 10월 9일
not in triangular wave i added 5 triangular and a sine wave to get the desired output as above ,but not getting the answer
Azzi Abdelmalek
Azzi Abdelmalek 2012년 10월 9일
If you have another problem, I suggest to post another question

댓글을 달려면 로그인하십시오.


Vijay P
Vijay P 2018년 5월 3일
Please guide me how to do in simulink.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by