How to plot this discrete waveform?

Discussion in 'Programmer's Corner' started by loiloi84, Sep 5, 2008.

  1. loiloi84

    Thread Starter New Member

    Sep 5, 2008
    1
    0
    = Using matlab=

    % duration pattern

    d(1,1:5) = [5 0 30 0 5 ];

    % magnitude patterns

    m(1,1:5) = [1 1.2 1.2 1.0 1.0];

    Hello , how can i plot this magnitude of [1 1.2 1.2 1.0 1.0] for the duration of [5 0 30 0 5 ]? Meaning the wave will remains at 1 for 5 cycles, 1.2 for 30 cycles and so on. Thanks in advanced
     
  2. Dave

    Retired Moderator

    Nov 17, 2003
    6,960
    144
    Just to be clear, you want to plot:

    - The magnitude of 1 for 5 cycles
    - The magnitude of 1.2 for 0 cycles (redundant)
    - The magnitude of 1.2 for 30 cycles
    - The magnitude of 1 for 0 cycles (redundant)
    - The magnitude of 1 for 5 cycles

    ?

    Dave
     
Loading...