Matlabs square(x) equivalent in Simulink? NOT x^2. square WAVE

조회 수: 204 (최근 30일)
Marek Andrzej
Marek Andrzej 2016년 10월 19일
댓글: Marek Andrzej 2016년 11월 1일
As in title, is there a block which performs this operation in a simple way?

답변 (2개)

Rodney Tan
Rodney Tan 2016년 10월 19일
There is a Math Function block in Simulink -> Math Operation, where you can configure it to perform various math operation including the square function. I have screen capture it for your reference below.
Hope this answer your question.
  댓글 수: 1
Marek Andrzej
Marek Andrzej 2016년 10월 19일
This is exactly what I am not looking for. A square(x) in matlab is this : Square wave

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


Rodney Tan
Rodney Tan 2016년 10월 24일
There is a Pulse Generator block in Simulink -> Source, where you can configure its magnitude, period and duty cycle to generates square wave as square(x) wave function. I have screen capture it for your reference below.
Hope this time I answer your question.
  댓글 수: 1
Marek Andrzej
Marek Andrzej 2016년 11월 1일
I didn't want to generate it, but managed to create a workaround:
which allowed me to change a signal of variable amplitude and freq into square form (although I moved it a bit to the right) By the way can you tell me why Minimum index- Maximum index was able to give me a square wave? Wrap to zero and abs are there to make the line "pretty".

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

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by