I have tried taking the conjugate of the S21 row vector, flipping it and adding to the original S21 and then taking IFFT.But the output is not as expected.
%Read the S parameter matrix and seperate the freq and s matrix data
sp=sparameters('C:\Users\PrasadNGanes\Desktop\snp_data\QVR_MX0100A_InfMode_SldrInFlat_Zin_2Port.s2p');
freq=sp.Frequencies;
s=sp.Parameters;
%Seperate the S21 column from S-matrix and plot S21
S21=rfparam(sp,2,1);
rfwrite(S21,freq,'C:\Users\PrasadNGanes\Desktop\snp\newS21.s2p');
sp_inv=sparameters('C:\Users\PrasadNGanes\Desktop\snp\newS21.s2p');
figure;
rfplot(sp_inv);
title('S21 plot');
fs=26999*10^6;
N=length(freq);
dt=1/fs;
t=(0:N-1)*dt;
S21_t=transpose(S21);
reconstructed_fft = [S21_t, conj(fliplr(S21_t(2:end-1)))];
%Take IIFT of S21 to get impulse response h(t) and plot Impulse response
impulse_response=ifft(reconstructed_fft);
figure;
plot(impulse_response);
title('impulse response');
%convolve output y(t) with 1/h(t) to get back the input x(t)
inverse_impulse=1./impulse_response;
%read the output y(t)
data=xlsread('C:\Users\PrasadNGanes\Desktop\snp_data\probe_output.xlsx');
out_time=data(:,1);
output=data(:,2);
convolution_result=conv(output,inverse_impulse);
convolution_time=linspace(min(out_time)+min(t),max(out_time)+max(t),length(convolution_result));
figure;
plot(convolution_time,convolution_result);
title('input plot after convolution');