No, you cannot do it automatically. The labelling of ground truth data, including both training and testing data, has to be done manually by yourself or by the provider of a public dataset.
If there is problem writing code in matlab then it will be better if you take the feature file containing all the features in a separate folder and write a C/C++ file handing code to separate the total feature set into training and testing set depending on your need.
As mentioned in other answers, you have to first determine the two classes you have. Then you can assign each class a GT Label (+1 / -1).
Once you have your data and labels ready, you can randomly divide it into training and testing set using: datasample function in matlab without replacement. A rule of thumb for single fold validation is that your training set should contain 70% of the total data while the rest goes into testing set.
where numSamples is the number of total samples you have, 0.7 is taking 70% of the data.
This returns the idx which is the index to the selected elements in the training set. Everything else goes to testing set. I hope this answer is clear for you as it is my first attempt on this site.