Matrix optimization result with applications