You have four choices:
- Decide on a sampling frequency and generate an output vector in which each value is repeated the appropriate number of times. repelem() can help.
- Use the data to generate an anonymous function that does conditional tests on the input time to decide what the output should be
- Use the data to generate an anonymous function that uses heaviside() to calculate the output given times
- Use the symbolic toolbox piecewise() to create a symbolic expression or function to calculate the output given times. Note that matlabFunction() to return anonymous functions cannot handle piecewise() constructs but that matlabFunction with the 'file' output can handle piecewise() but cannot handle vectors of times together with piecewise()