The SPWM in Matlab...

Discussion in 'Programmer's Corner' started by FBorges22, Jul 9, 2009.

  1. FBorges22

    Thread Starter Active Member

    Sep 11, 2008
    104
    0
    Greetings,

    I am trying to representate a SPWM comparing a 30kHz triangle wave with a 60Hz sine wave using the MatLAB. However, I do not know how to compare two functions in him. Recently I generated this graph containg the sine and the triangle wave functions... How I can generate the SPWM?

    Here is my .m script:

    Code ( (Unknown Language)):
    1. x1 = 0:0.01:20;
    2. x2 = 0:0.01:20;
    3. plotyy(x1,170*sawtooth(15*x1,0.5),x2,170*sin(x2));
    4. axis([0,20,-200,200]);
    5. title('SPWM Modulation');
    6. ylabel('Voltage (V)');
    7. xlabel('Time (s)');
    Thanks,
    FBorges22
     
Loading...