Two-dimensional hydrodynamic calculations for a self-gravitating, magnetic and compressible medium are carried out. The results based on numerical simulations show that the joint effect of the nonlinearity of the hydrodynamic equations and self-gravity is the mechanism for generating the observed complex structure of molecular clouds (e.g. clumps and filaments). In addition, parameters such as the evolution time of molecular clouds, the density contrast, fractal dimension, and the velocity probability distribution are derived. Their possible relation to the observed properties of molecular clouds are discussed.