Results 1 to 4 of 4

Math Help - matlab changing time scale on a waveform

  1. #1
    edm
    edm is offline
    Newbie
    Joined
    Jul 2009
    Posts
    6

    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
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    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
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    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
    Follow Math Help Forum on Facebook and Google+

  4. #4
    edm
    edm is offline
    Newbie
    Joined
    Jul 2009
    Posts
    6
    great, thanks for you help CB!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. plot of a function of time a matlab question
    Posted in the Math Software Forum
    Replies: 7
    Last Post: December 12th 2011, 01:12 PM
  2. Changing the order of matrix in Matlab
    Posted in the Math Software Forum
    Replies: 1
    Last Post: October 14th 2011, 07:14 PM
  3. [SOLVED] Continuous-Time Fourier Transform of a Response (matlab)
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: July 1st 2010, 12:04 PM
  4. Matlab Graphing Continuous-Time Impulse (Dirac-Delta)
    Posted in the Math Software Forum
    Replies: 0
    Last Post: June 23rd 2010, 02:03 PM
  5. changing in time problem
    Posted in the Calculus Forum
    Replies: 1
    Last Post: September 9th 2008, 03:52 PM

Search Tags


/mathhelpforum @mathhelpforum