how can I update a constant block within a Simulink simulation?
조회 수: 14 (최근 30일)
이전 댓글 표시
I have created a Simulink model that takes variables (constants) from the Workspace. Within the Simulink model I have added a Matlab function that recalculates these constants after each iteration. However, after each iteration, instead of considering the newest value calculated for each variable, the model takes again the value I set from the Workspace in the beginning. Any idea on how I can update my values each step?
Thanks, Omar
댓글 수: 0
답변 (2개)
Hari Desanur
2016년 11월 15일
The variables you are updating might be local to your MATLAB function.
Consider defining the variables in the MATLAB function as persistent or global . This might resolve the issue where the changes being made to the variables are not reset.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!