For loop for SVM variable files
Mostrar comentarios más antiguos
I want to classify my data with SVM on MATLAB. I have a folder, this folder has 70 sub-folders. Each of the 70 sub-folders has three preprocessed .mat files(selected features). These three files are my predictor variables. My design matrix is in a .mat file. Inside the design matrix, there are 3 items, out of which I want to use 2 as my class variables.
Using fitcsvm or any other Matlab svm function, I'm trying to classify that the predictor variables Fall into one of the two classes.
How do write a for loop that runs through these subfolders so that X = the predictor variables and Y= the class variables.
Respuesta aceptada
Más respuestas (1)
Pamudu Ranasinghe
el 7 de Jul. de 2022
1 voto
I think you can use "datastore" function in matlab
You dont need to loop through the files use 'IncludeSubfolders' to 'true' in datastore function.
This will do your work
Categorías
Más información sobre Neuroimaging en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!