A motor unit and a vehicle equipped with the unit according to the
invention includes a control unit that selects a switching frequency,
that is, a carrier frequency, in accordance with a rotation speed of the
motor and a torque required from a motor. When an inverter temperature
becomes high, the control unit limits the torque of the motor to suppress
further increase in the inverter temperature. A limit value used in
restricted operation is determined in accordance with the temperature and
the carrier frequency of the inverter.