In this study, a method is devised to estimate a correlation matrix capable of constructing a well-diversified portfolio by the Markowitz mean-variance (MV) optimization function (MVOF), after which evidence is presented to empirically prove that the proposed method effectively reduces the sensitivity of portfolio output caused by the error of input variables, such as the mean and standard deviation of stocks in a portfolio. The proposed method removes the property of a market factor included in the sample correlation matrix through random matrix theory. The results demonstrate the comparative advantage of the proposed method in effectively reducing the sensitivity on both the estimation error and the prediction error from the mean and standard deviation. In particular, this comparative advantage is dependent on the striking reduction of portfolio risk gained by constructing the well-diversified portfolio. The proposed method also achieves high investment performance in the risk-return domain, and is particularly stronger in the unstable situation of either a market crash or a higher-risk portfolio. Consequently, this study offers new insight into how to enhance the practical applicability of the MVOF by controlling the property of the market factor in the sample correlation matrix.