How can I specify a sim. start point?
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Schedule Model Components in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!