Simulink Ramp - On Demand
이전 댓글 표시
Hello,
I would like to have a signal ramp from a min. value to a max value. and back down again, in a set amount of time. I initially did this with persistent variables which allowed me to reset the ramp signal and run it essentially on demand. Is there a simple work around that doesn't involve the use of persistent variables?
On a related note, is it possible to output the sample time as a variable? I've tried using a clock with a memory block, and subtracting to get the sample time, but for a fixed step size of 0.0001, the sample time is not constant but varies between 0.0009999 and 0.0001.
Thanks
댓글 수: 4
There are a few things that are unclear to me in your question.
1) What do you mean by "persistent variables" in Simulink?
2) Are you sure that you have the right number of zeros in your time step numbers, or could it be 0.0000999 and 0.0001. These would be essentially the same value in digital representation (variation only in the least significan bit). If you set the model time ste to a fixed size, it should not vary, but computing the step by taking the difference between two numbers may have some "noise" in the LSB.
Julian Pires
2019년 1월 31일
Abdur
2025년 11월 29일
There are a few things that are unclear to me in your question. 1) What do you mean by "persistent variables" in Simulink? 2) Are you sure that you have the right number of zeros in your time step numbers, or could it be 0.0000999 and 0.0001. These would be essentially the same value in digital representation (variation only in the least significan bit). If you set the model time ste to a fixed size, it should not vary, but computing the step by taking the difference between two numbers may have some "noise" in the LSB.
Abdur
2025년 11월 29일
Good
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!