Do not redefine the important Matlab function cd as a variable, because this can cause serious troubles during debugging.
[T,Z]=ode45('vdp', [0:step:t0], [0,1], opts);
Providing a function to be integrated as a char vector is outdated for over 15 years now. Although this is still supported for backwar compatibility, it is less powerful and secure than a function handle. In addition a function handle allows to define a parameter:
p = 3.1415;
[T,Z] = ode45(@(t,y) vdp(t, y, p), 0:step:t0, [0,1], opts);
function dy = vdp(t, y, p)
By the way, o:step:to is a vector already. Using the Matlab operator for array concatenation  is a waste of time here only.
Another problem can cause invalid outputs: Your function to be integrated is not smooth:
Matlab's ODE integrators are designed to process smooth functions only. Otherwise the step size controller can drive completely mad, which can cause different effects: A stop with an error message (minimal step size exceeded), or even worse a result, which is dominated by rounding errors due to a massive increase of the evaluated steps. Don't do this. Do not use a numerical tool for a computation, which does not match the specified limitations.
Use event functions instead, which stop the integration when the state of the function changes.