Simulink: Need help using simulation time as a variable in Simulink Calculations

Hi,
I'm working on some Simulink code that does calculations for elastances in the heart and I want to set the simulation time and step size to be controlled by variables in my MATLAB script. I also was trying to figure out how to use the simulation time as a variable to input into my calculations. So for example, if the current simulation time is 2.05 seconds I want to use that single value in the area circled in blue below. I'd greatly appreaciate the help with this. Please let me know if you need more explaination.
Thanks!

댓글 수: 1

I've attached an image depicting my code and the area I need help with in the Time Image.PNG.

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

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2020년 7월 25일
Use the Clock block from Simulink Sources.

댓글 수: 3

I need to use a specific sampling rate. Would it be better to use the digital clock for that input in my Simulink code?
I just tried it and it worked great. Thanks for the help!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2020년 7월 24일

댓글:

2020년 7월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by