This paper is mainly concerned with solving the following two problems:Problem I. Given X ∈ Rn×m, B ∈ Rm×m. Find A ∈ Pn such that‖XTAX-B‖F=min,where Pn={A∈Rn×n|xTAx≥0, x∈Rn}.ProblemⅡ.Given A∈Rn×n.Find A∈SE such that‖A-A‖F=min A∈SE‖A-A‖F,The general solution of Problem Ⅰ has been given. It is proved that there exists a unique solution for Problem Ⅱ. The expression of this solution for corresponding Problem Ⅱ for some special case will be derived.