I understand that you want to extract data by using provided indices.
There are a few ways to extract data from a MATLAB training set using indices. One way is to use the ‘subset()’ function. The ‘subset()’ function takes a training set and a vector of indices as input and returns a new training set containing the data at the specified indices.
Another way to extract data from a MATLAB training set using indices is to use the linear indexing syntax. Linear indexing allows you to access individual elements of a matrix using a single index.
For further information, refer to the documentation links below: