modified cad_train_subtype.m