Here is a bunch of code from MATLAB documentation: Designing a Basic Monostatic Pulse Radar:
wav = phased.RectangularWaveform(...
'PulseWidth',1/pulseBandwidth,...
'PRF',PRF,...
'SampleRate',Fs);
matchingcoeff = getMatchedFilter(wav);
hmf = phased.MatchedFilter(...
'Coefficients',matchingcoeff,...
'GainOutputPort',true);
[rx_pulses, mfgain] = step(hmf,rx_pulses);
How MATLAB calculates the mfgain
(matched filter gain)? Any formula for that?