Capacitor discharge matlab