Optimal Variable Clustering for High-Dimensional Matrix Valued Data