Possible memory corruption when running LINMOD
1 次查看(过去 30 天)
显示 更早的评论
All,
Attached is a .zip with a simple script and model that illustrates a possible memory corruption problem that I've run into in a larger system (NOTE: the .slx is saved in R2015b).
- Open both the .m and .slx
- run 'testSim_INIT.m' as is
- If you see some diverging signals on the scope then the simulation successfully ran
- Go to the last code section on 'testSim_INIT.m' and run just that section (click in section and CTRL+ENTER)
You should get the following error,
Expected an integer value, found an non-integer variable with value 1e-05 .
MATLAB Function 'MATLAB Function': var(:,i) = rand(6)*var(:,list(i));
^^^^^^^
Now, open the matlab function 'myTest' on the block diagram of 'testSim.slx'. Comment out the line,
list = model.list;
and uncomment the line,
list = (0:4);
Now, rerun steps 1-4. Notice that LINMOD now runs w/o error.
You can repeat these tests after toggling the manual switch on the block diagram to route 'In1' to the 'myTest' instead of the constant.
QUESTION/CONCLUSION:
It seems to me they there is a memory corruption as the error claims have received a non-integer value out of 'list(i)'. I have seen the exact same results in R2015a, R2015b and R2016b.
Am I simply missing something obvious?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!