How can I specify a sim. start point?

조회 수: 1 (최근 30일)
Michael Hodgson
Michael Hodgson 2021년 10월 7일
My sim. has feed-back, and the code in the feed-back loop, in a "Matlab function block," is producing an error which makes it seem that the output variable is not getting populated before going into the feed-back loop code:
"=== Simulation (Elapsed: 10 sec) ===
Error:Index expression out of bounds. Attempted to access element 2. The valid range is 1-1.
More information
Function 'Matlab function for u1.' (#30.146.147), line 7, column 17:"
where line 7 in the "Matlab function block" code is:
h2 = heights(:, 2);
where "heights" is my output variable. If the sim. started at the input, this error should not occur. "Heights" shows in the Workspace as being fully populated (from a previous run, which didn't use the above feed-back loop). Does the sim. use a separate workspace? Is that what the "Model Workspace" in the Model Explorer is? Currently it's empty, so something is definitely not working.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Schedule Model Components에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by