# MATLAB: Evaluate the system impose response function and the FRF with given input and output data

signal processing

Hello!
I have the input and output data of a signal that is stored in a .mat file. I need help calulating the impulse response and the FRF. I have attached the .mat file. I know how to pull the info from the .mat file and the time length is 20 sec
data = importdata ('beam_experiment.mat');
x = transpose(data.x); %input
y = transpose(data.y); %output
fs = data.fs; % sampling frequency
T1 = 20;
I tried the follow:
data = iddata(y, x, 1/fs);
h = impulseest(data,2*max(time)*fs, min(time)*fs);
H = fft(h);
but get the following error message "Error using fft
Invalid data type. First argument must be double, single, int8, uint8, int16, uint16, int32,
uint32, or logical."
Could somone kindly help out?

data = importdata ('beam_experiment.mat');x = transpose(data.x); %inputy = transpose(data.y); %outputfs = data.fs;   % sampling frequencyT1 = 20;NFFT = 2048;NOVERLAP = 0.75*NFFT;[Txy,F] = tfestimate(x,y,hanning(NFFT),NOVERLAP,NFFT,fs);% IIR modelW = linspace(0,pi,length(F));ind = find(F>5 & F <80); % frequency weighting ; data reliable between 5 and 80 HzWT = zeros(size(W));WT(ind) = 1;NB = 6;NA = NB+2;[B,A] = invfreqz(Txy,W,NB,NA,WT,1e4);% check bode plots[H,WW] = freqz(B,A,length(F));figure(1),subplot(2,1,1),plot(F,20*log10(abs(Txy)),'b',F,20*log10(abs(H)),'r');gridsubplot(2,1,2),plot(F,180/pi*(angle(Txy)),'b',F,180/pi*(angle(H)),'r');grid% Impulse response [IR,X] = dimpulse(B,A);samples = length(IR);time = 1/fs*(1:samples);figure(2),plot(time,IR,'r');gridtitle('Impulse response')xlabel('Time (s)');ylabel('Amplitude')