Time dependent matrix entry

조회 수: 1 (최근 30일)
Christo van Rensburg
Christo van Rensburg 2021년 10월 26일
댓글: Christo van Rensburg 2021년 10월 28일
Good day,
I've got a repeating sequence block with a 1x2-matrix for the durations of the output values. I however need to change these values, each entry, according to a ramp function that implements a linear increase. Below is a setup of the model I currently have in Simulink.
Any idea on how I can achieve this?

채택된 답변

Jon
Jon 2021년 10월 26일
편집: Jon 2021년 10월 26일
Under source blocks in the Simulink library there is a block called Ramp. It seems like this should work for your purpose.
  댓글 수: 6
Jon
Jon 2021년 10월 27일
편집: Jon 2021년 10월 27일
I now see you want the square wave to go from say 0 to 5 rather than -1 to 1. You can just add 1 to the output of the sign block (using a sum block and constant) and then scale it with a gain block.
If you need the on and off (low and high values) duration to be different, you can offset the chirp signal (add a constant) before you apply the sign function.
Christo van Rensburg
Christo van Rensburg 2021년 10월 28일
Hi John,
So I actually managed to figure it out on my own using the blocks shown below:
So what happens is:
  • Using a "Variable Pulse Generator" block to generate pulses with the frequency specified by the preceeding blocks.
  • I then simply add the appropriate gain (5).
  • Finally, each signal is delayed by a time stamp according to my requirement with the "Transport Delay" block.
But thanks once more for your time and effort to help me get to the bottom of this!
Christo

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by