Why tout is different from the result of time block in Simulink?
15 ビュー (過去 30 日間)
古いコメントを表示
In the Simulink model I create, I use a time block to record the time and output it into the workspace. The problem is that the output from the time block is different from the system default tout. The length of the vector directly output from the time block is 421, and the length of tout is 433. Thus, the other output of the system has different length of vector, some as 421 some as 433. Why this happen and how to correct?
0 件のコメント
採用された回答
Birdman
2018 年 4 月 10 日
Actually, this has something to do with your solver settings. Probably, your solver type is set to variable step and you record time to your workspace with a defined sampling time of its own. tout time array is saved to the workspace with a sample time that solver automatically selects but your time data is saved with a predefined sampling time. The difference occurs from that. Change your solver type to fixed step and define the same sampling time with your saved time data. Then, they should have the same length. Hope this helps.
3 件のコメント
Shaik Merkatur Hakim Marjuban
2020 年 4 月 22 日
Add a line "sim('x')" before plot. the x=the file name of simulink. try this
Abdullah
2024 年 3 月 14 日
Hello Birdman,
when i change the solver to fixed step, there are no resulst can be shown. sample fixed step is lower than the sample rate of the controller
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で General Applications についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!