Matrix converter (MC) is an AC-AC converter which provides power flow between AC power supply and the load with different voltage and current requirements. Its relatively small power circuits and simple control structures provide considerable advantages to itself according to the classical AC-AC converter topologies. In this simulation study, optimal control approach based on Crazy Particle Swarm Optimization (CPSO) algorithm is suggested in order to control the Direct Matrix Converter (DMC). The function of CPSO algorithm in the proposed controller is to both minimize the cost function which is the significant part of the optimal controller and also produce the optimum switching states at each switching period. At the end of the study, the results obtained from the DMC system show that the CPSO algorithm based optimal controller provides desired steady-state response towards different load frequency conditions.