https://se.mathworks.com/help/signal/ref/settlingtime.html
settlingtime - Settling time for bilevel waveform - MATLAB
This MATLAB function returns the time from the mid-reference level instant to the time instant each transition enters and remains within a 2% tolerance region...
time forsettlingbilevelwaveformmatlab