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:
Thanks,
FBorges22
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:
Rich (BB code):
x1 = 0:0.01:20;
x2 = 0:0.01:20;
plotyy(x1,170*sawtooth(15*x1,0.5),x2,170*sin(x2));
axis([0,20,-200,200]);
title('SPWM Modulation');
ylabel('Voltage (V)');
xlabel('Time (s)');
FBorges22
Attachments
-
8.9 KB Views: 87