0
votes

I'm running a SimEvents simulation using Variable-step discrete solver. I save a signal data using a 'to Workspace' block, but the plot that I obtain is different from the one shown in the 'Scope' block inside the model.

The original signal remains constant between t=64[h] and t=65.4[h] (and this seems to be correctly done also in the matlab plot), while elsewhere it is like the plot command and the 'scope' block are working with different "sample times".

I'd like to obtain a plot showing the typical "step shape" of a discrete signal rather than a "nearly continuous" signal.

I've used the Scope 'save data to workspace' as well, but I didn't solve the problem.

I would have attached some screenshots in order to make the question more complete, but this is my first question so I have not enough reputation to post images. If you need, I can send them to you via e-mail.

Thank you in advance!

1

1 Answers

0
votes

There are no screenshots to look at, but my guess would be that the signal is discrete, and the Simulink scope block, knowing this, is only changing at the discrete time points.

However, if you are plotting the data dumped to MATLAB using the standard plot function then it treats the data as continuous and joins successive points with a (non-constant) line. If that's the case, you most likely want to be using the stairs function to do your MATLAB plottig.