I'm required to simulate the DC UPS system using MATLAB software, but i really dont have any idea to do the PWM connection using MATLAB. so, is there any matlab circuit of pwm to compare the output voltage, in order to the battery charging and discharging?