I have my confusion matrix as C.mat8263    20    392       3826  1443       7    4431 My predicted class labels are Ypred and actual labels are Ytest. Ypred size is 16000*1 and Ytest 16000*1.I am trying to calculate the R-squared and RMSE. Is there a way to directly calculate RMSE and R-squared from the confusion matrix?I tried this:RMSE = sqrt(immse(Ypred, Ytest))However, it didn't work.I can use  either R or Matlab.Any advice will be appreciated!
Calculating RMSE AND R-squared from the confusion matrix
multiclass classification;confusion matrix