matlab record ecg from sound card
realtime..huh.. it seems to be tough..
because each time signal is stored first for some moment..
then only it will displayed... if you still want to do in realtime then
better you go for matlab simulink realtime enviornment...
simple code to check acquired signal..
ai=analoginput('winsound'); % analog input by the defined function winsound
addchannel(ai,1); % Channel is defined here
ai.SampleRate=8000; % Minimum sample rate=8000
ai.SamplesPerTrigger=24000; % Acquiring data for 3 Minutes
ai.TriggerType='Immediate'; % 8000*N for more time
start(ai); % open connection and display
[d,t] = getdata(ai);
plot(t,d);
zoom on;
check this...