Index exceeds matrix dimensions sim command, not in Simulink
古いコメントを表示
I tried finding a solution to my problem, but all the hits on both google and on-site search came with topics that were not similar to mine. Apologies if I didn't look far enough.
My issue: I have a Simulink model and a .m file in which I write parameters and run the simulation using the sim() command. Since a short while, I cannot remember what changes I made that started this, Matlab returns the 'Index exceeds matrix dimensions' error whenever I run the sim() command or when I Rightclick on the .slx file and hit Run in the folder-viewer in matlab (or F9 hotkey). However, if I run the config with the sim() command commented out and manually hit the green Simulate button inside the simulink model, it does run perfectly fine.
Has anybody heard about this before? Does anyone know what could be causing this?
The config file itself is just a series of parameter settings, ending with:
sim('ICSMS_Project_Model')
The simulink file is called ICSMS_Project_Model.slx.
Note that it has worked before, and now doesn't work anymore and I lost track where it stopped working.
4 件のコメント
Dave Lee
2019 年 8 月 1 日
I am running in the same situation. Did you have it figured out yet?
Nathan Reiling
2019 年 8 月 1 日
Dave Lee
2019 年 8 月 1 日
Thanks for the reply. I realized that when you run into this situation, even if you create a new and simple Simulink model e.g. a constant wired to a scope and try sim command with it, you still have this issue.
Nico Rossouw
2020 年 7 月 29 日
Do you perhaps have a variable/struct named "sim"? I had one, and renaming it solved this behavior for me.
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!