Assuming you have already generated the output of the stepper motor, you can use the following steps to plot the motor values as well as the theoretical values in MATLAB:
t
that represents the time steps at which the motor output was generated.output
that represents the motor output values.theoretical
.output
and theoretical
vectors against the t
vector using MATLAB's plot()
function. Example code is provided below:main.m466 chars16 lines
The above code assumes that the motor output and theoretical values have the same number of data points as the time vector. If they don't, you'll need to modify the code accordingly.
gistlibby LogSnag