How can I specify a sim. start point?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Schedule Model Components에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!