| 
July 26th, 2009, 05:12 PM
| | Newbie | | Join Date: Jul 2009
Posts: 6
Country: Thanks: 0
Thanked 0 Times in 0 Posts
| | matlab changing time scale on a waveform hi,
i have a waveform which i have read in using matlab.
fs = 200, waveform length = 20s.
if i read in waveform and plot() it, without setting 't', matlab will auto generate a scale from 0 to 4000
using plot(waveform(1800:2200)) will show me 2 cycles.
and i can plot the full waveform with correct time scale by t=(0:length(ecgclean)-1)/fs;
but how can plot waveform only over 2 cycles using the correct time scale?
arghh, i know it will be trival but i just cant get it work!
thanks for any help | 
July 26th, 2009, 09:04 PM
|  | Grand Panjandrum | | Join Date: Nov 2005 Location: South of England
Posts: 12,271
Country: Thanks: 777
Thanked 3,995 Times in 3,223 Posts
| | Quote:
Originally Posted by edm hi,
i have a waveform which i have read in using matlab.
fs = 200, waveform length = 20s.
if i read in waveform and plot() it, without setting 't', matlab will auto generate a scale from 0 to 4000 | No it won't look more closely the scale runs from 1 to the number of sample points.
CB
__________________ Truth does not change because it is, or is not, believed by a majority of the people.
Giordano Bruno | 
July 26th, 2009, 09:07 PM
|  | Grand Panjandrum | | Join Date: Nov 2005 Location: South of England
Posts: 12,271
Country: Thanks: 777
Thanked 3,995 Times in 3,223 Posts
| | Quote:
Originally Posted by edm hi,
i have a waveform which i have read in using matlab.
fs = 200, waveform length = 20s.
if i read in waveform and plot() it, without setting 't', matlab will auto generate a scale from 0 to 4000
using plot(waveform(1800:2200)) will show me 2 cycles.
and i can plot the full waveform with correct time scale by t=(0:length(ecgclean)-1)/fs;
but how can plot waveform only over 2 cycles using the correct time scale?
arghh, i know it will be trival but i just cant get it work!
thanks for any help | Code: ddata=ecgclean(1800:2200);
plot([0:length(ddata)-1]/fs,ddata);
CB
__________________ Truth does not change because it is, or is not, believed by a majority of the people.
Giordano Bruno | 
July 27th, 2009, 10:06 AM
| | Newbie | | Join Date: Jul 2009
Posts: 6
Country: Thanks: 0
Thanked 0 Times in 0 Posts
| | great, thanks for you help CB! | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -7. The time now is 09:27 AM. | | |
 | |  |