https://ch.mathworks.com/help/dsp/ref/iirgrpdelay.html
iirgrpdelay - Optimal IIR filter with prescribed group-delay - MATLAB
This MATLAB function returns an allpass IIR filter of order n (n must be even) which is the best approximation to the relative group-delay response described...
optimaliirfilterprescribedgroup