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!