How do I reset the signal output?

조회 수: 2 (최근 30일)
Feng Zhou
Feng Zhou 2017년 3월 25일
댓글: Feng Zhou 2017년 3월 26일
For example I have a ramp signal with slop=1 starting at t=0. When it gets to t=6 the signal value is 6. What I needed is reset the signal for the first 3 second so at t=0 to t=3 signal value is 0, and from t=3 to t=6 the signal value rise from 0 to 3 (not 6) at t = 6. I am a beginner of simulink, and spend so much time on this problem. Many thanks to who can find a approach solving this.

답변 (1개)

Michelangelo Ricciulli
Michelangelo Ricciulli 2017년 3월 25일
편집: Michelangelo Ricciulli 2017년 3월 25일
I think that the answer you are searching is the "modulo" operation. Let's say your ramp is stored in vector y and you want the new ramp in y_new. Then in Matlab you should do
y_new=mod(y,3);
In simulink, there should be a "Math Function" block, that you can configure to act like
output=mod(input,3);
  댓글 수: 1
Feng Zhou
Feng Zhou 2017년 3월 26일
thanks for your reply, I wonder is there any way I can do it dynamically? For example the time that remap start to rise t = 3 can be decided by a input in simulink? I was trying to use the enable subsystem to accomplish it, but when the singal is enabled, the value always goes where i was suppose to be (=6 at t=6 at this case not 3 at t = 6). Thank you!!

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

카테고리

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