You can use the stairs function in MATLAB to plot the output data from Simulink when operating in discrete mode. Here's an example:
main.m353 chars15 lines
In this example, my_model is the name of your Simulink model, StopTime is the time at which the simulation should stop, and FixedStep is the simulation time step. The output of the simulation is stored in tout and yout, which are passed to stairs to plot the output data.
gistlibby LogSnag