Classify responses into categories
Afficher commentaires plus anciens
Hello, hope someone can help me because I am totally blank!
I have a 10 by 6 matrix. Each row reflects the response of one participant and each column represents a different stimulus
responses = rand(10,6)
I also have 6 by 2 cell array. Each rows here represents each of the six stimulus and the column the condition they belong to
stimuli = {'a', 'HF'; 'c', 'MF'; 'g', 'MF'; 's', 'LF'; 'T', 'HF'; 'v', 'LF'}
I would like to classify the data into responses to HF, MF and LF conditions. I know that I would need to use a for loop and probably either if or switch statement, but however I am blank and don't even know how to start.
Thanks!
6 commentaires
Guillaume
le 6 Mar 2018
I know that I would need to use a for loop and probably either if or switch statement
Most likely, it can be done a lot easier without loops, ifs or switches. However, I have no idea how the two arrays are linked other than the columns of one somehow correspond to the rows of the other.
Can you explain better what sort the data into responses mean?
Alejandro Estudillo
le 6 Mar 2018
Image Analyst
le 6 Mar 2018
And it's still confusing. Let's say that row 3, column 3 of the (poorly named) "a" is 0.4356. What do I do with that? Am I supposed to somehow pick one of the 12 letters in (the also poorly named) "b" to create your output/classification matrix? If so, which one? Please give an actual example with actual numbers and explain how each number was used to create the element in the output/classification matrix. http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
Alejandro Estudillo
le 6 Mar 2018
Modifié(e) : Alejandro Estudillo
le 6 Mar 2018
Guillaume
le 6 Mar 2018
So, the first column of stimuli is irrelevant for your question, then? And really all you want to do is split responses into three matrices with columns [1 5] together, columns [2 3] together and columns [2 6] together (according to this particular stimuli cell array)
This can be easily done but the more important question is why? Splitting one variable into multiple variable usually makes subsequent calculations harder rather than easier. Keeping the labels of the columns separated as you have now is probably best.
Alejandro Estudillo
le 7 Mar 2018
Modifié(e) : Alejandro Estudillo
le 7 Mar 2018
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!