I understand your concern regarding Decision Tree (fitctree) model not predicting one of the classes (class B) while SVM (fitcecoc) model is correctly classifying all four classes (A, B, C, D).
This almost always comes down to class imbalance and a simple tree. With default settings, a single tree (fitctree) will happily create leaves that never predict a minority class if the splits don’t isolate it cleanly. An SVM (fitcecoc) draws global boundaries and often still carves out some region for that small class, so you see B with SVM but not with the tree.
One of the possible reasons would be that the dataset could have been imbalanced i.e. class B is having a lesser number of samples. To mitigate this issue, bagging methodologies like "random forest" could be used.
You can refer to the below MATLAB documentations for more deatils:
- random forest: https://www.mathworks.com/help/stats/select-predictors-for-random-forests.html\
- ensemble algorithms: https://www.mathworks.com/help/stats/ensemble-algorithms.html
Hope this helps!