Fixing a weakly unobstructed Lagrangian torus in a symplectic manifold X, we define a holomorphic function W known as the Floer potential. We construct a canonical A∞-functor from the Fukaya category of X to the category of matrix factorizations of W. It provides a unified way to construct matrix factorizations from Lagrangian Floer theory. The technique is applied to toric Fano manifolds to transform Lagrangian branes to matrix factorizations. Using the method, we also obtain an explicit expression of the matrix factorization mirror to the real locus of the complex projective space.