Different time step while saving two dataset from Simulink to workspace using "to workspace" block even after setting the timestep same for both.

3 次查看(过去 30 天)
I am trying to log two datasets from Simulink to two variables using "to workspace" block. I have set time & timestep for both blocks equal, still after logging, the dimensions of data is different.
Similar settings are done for other block except the varibale name.
What would be the reason behind having different dimensions after logging data to workspace?

回答(1 个)

Shishir Reddy
Shishir Reddy 2024-9-10
Hey Yash
As per my understanding, you logged two datasets from Simulink to MATLAB workspace using the ‘To Workspace’ block and observed that the dimensions of the data exported are different even if the blocks are configured with the same settings.
Here are a few potential causes of the issue –
  • If one signal is event-driven (e.g., triggered by a specific condition), it might produce fewer data points compared to a continuously sampled signal.
  • Different initial conditions for the signals can lead to different lengths of data if one signal reaches a steady state or a stopping condition before the other.
  • If any data processing or filtering is applied to one of the signals before logging, it might alter the data length.
Debugging steps –
  • Display blocks can be added to the signals before logging to visually confirm they are identical during simulation.
  • ‘Simulation Data Inspector’ can be used to compare the signals during simulation to identify discrepancies. For more information regarding ‘Simulation Data Inspector’, kindly refer the following documentation - https://www.mathworks.com/help/simulink/slref/simulationdatainspector.html
I hope this helps resolving the issue.

类别

Help CenterFile Exchange 中查找有关 Analyze Simulation Results 的更多信息

产品


版本

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by