how to plot magnitude vs frequency of ECG signal taken from database in MATLAB? load 100m
x= val(1,:);
fs = 1000;
Fn=fs/2;
Ts = 1/fs;
t = (0:length(x)-1)/fs;

subplot(3,1,1)
plot(t,x)
title('input signal')

y = fft(x); 
fr=freqz(y);
f = (0:length(y)-1)*5/length(y);
subplot(3,1,3)
plot(f,abs(y))
title('Magnitude')
Try using fvtool or freqz for frequency domain analysis. You need z-transforms of your equations, but I found fvtool particularly useful in analyzing the signals as it shows multiple plots (magnitude, phase, group delay, zero-pole diagrams etc.)