Math Help Forum

Math Help Forum Feed Site Feed

Go Back   Math Help Forum > Math Resources > Mathematics Software Discussion
Reply
 
Thread Tools Display Modes
  #1  
Old July 26th, 2009, 05:12 PM
edm edm is offline
Newbie
 
Join Date: Jul 2009
Posts: 6
Country:
Thanks: 0
Thanked 0 Times in 0 Posts
edm is on a distinguished road
Default 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
Reply With Quote
Advertisement
 
  #2  
Old July 26th, 2009, 09:04 PM
CaptainBlack's Avatar
Grand Panjandrum
 
Join Date: Nov 2005
Location: South of England
Posts: 12,271
Country:
Thanks: 777
Thanked 3,995 Times in 3,223 Posts
CaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond repute
Default

Quote:
Originally Posted by edm View Post
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
Reply With Quote
  #3  
Old July 26th, 2009, 09:07 PM
CaptainBlack's Avatar
Grand Panjandrum
 
Join Date: Nov 2005
Location: South of England
Posts: 12,271
Country:
Thanks: 777
Thanked 3,995 Times in 3,223 Posts
CaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond repute
Default

Quote:
Originally Posted by edm View Post
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
Reply With Quote
  #4  
Old July 27th, 2009, 10:06 AM
edm edm is offline
Newbie
 
Join Date: Jul 2009
Posts: 6
Country:
Thanks: 0
Thanked 0 Times in 0 Posts
edm is on a distinguished road
Default

great, thanks for you help CB!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -7. The time now is 09:27 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
©2005 - 2009 Math Help Forum


Math Help Forum is a community of maths forums with an emphasis on maths help in all levels of mathematics.
Register to post your math questions or just hang out and try some of our math games or visit the arcade.