摘要:SPWM is an essential modulation algorithm in power electronic devices, but it is not easy for unskilled programmer or junior engineers to build the code effectively. Model programming with embedded target supporting package in Matlab/Simulink is a new method to replace the traditional code writing without complicacy. Comparing to the manual method, it is more effective with lower cost, and the most importantly, it is more reliable. This paper offers a popular asymmetric sampling SPWM prototype with algorithm deduction, codes and models from Matlab RTW-EC. Finally, a practical result which can prove the method to be functional is also provided. This may accelerate the power electronics developing project with reliability in projects.