Create EEG_ICA_kmeans

Purpose : After running ICA on the EEG data, it is now important to try to understand what each of the independent components represent. When dealing with a large sample of subjects with many runs of different tasks, doing this task manually would be extremely burdensome. In addition, personal bias may be introduced in such a process, so having a more automatic way to characterize, or group, the components would be beneficial.

I established this script to automate this process using kmeans to cluster the indpendent components. It will load all of the '.mat' ICA files for each subject and concatenate into one big structure where each row is a subject and each column is the component. Then it will run kmeans.

You can specify what value of k you want, but given that my data has 32 channels, I can get a maximum of 32 ICs. I run 1 through 32 to see what works the best.