Simout and solver step time

10 次查看(过去 30 天)
Daniel Weber
Daniel Weber 2019-5-25
Hello,
I'm currently trying to plot Simulink data (for cosmetic reasons) in MATLAB. For that I'm using the simout block.
I have multiple simout blocks in the same subsystem, and some of them work as intended, with data-time pairs corresponding to the auto timestep of the solver. The plot with the exported data in the workspace looks exactly like on the Simulink scope.
On the other hand there are some blocks where the graphs don't match, and the step time in this data is constant 0.01, which looks makes the signals look bad.
I attached the following picture where you can see two graphs, which should be identical (zoomed in as far as I could on the left scope).
Does someone know how to fix these issues? I already played with the sample times of the model/ blocks but nothing changes.
Thanks in advance,
Daniel
test.png

回答(1 个)

Sulaymon Eshkabilov
Hi Daniel,
Your chosen time step 0.01 is showed up in your right zoomed in plot that is correct and can't be ideal step function as shown in your left scope's plot. If you decrease the step size (0.001 or 0.0001 or even smaller) the slope (shown in your right plot) gets steeper and comes closer to the ideal step, but never be an ideal step function.
Good luck.

类别

Help CenterFile Exchange 中查找有关 General Applications 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by