I have inputed the following, I was given a signal and told to plot it in a time domain. The signal ECG is a data file and imported.(adsbygoogle = window.adsbygoogle || []).push({});

N = 15000;

fs = 250;

t = linspace(0, 60, N);

%signal = ecg data = ecg

subplot (2,1,1);

plot (t,ecg);

title ('Time-Domain ECG')

xlabel ('Time (s)')

ylabel ('Magnitude')

The above works just fine, but I wish to focus on a part of the data.

The problem is I do not know how to isolate a segment of the data, I'm not very experienced in MATLAB. The data represents heartbeats, and my goal is to plot one from the raw data, say for instance from time 50-60.

I had thought perhaps the following would work:

plot (t(50:60),ecg(my start point:end);

Obviously it does not, so I'm asking for some help.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab and Signals processing

**Physics Forums | Science Articles, Homework Help, Discussion**