Possible memory corruption when running LINMOD
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!