Separate and Operate on Cells Based on Label
Show older comments
Hello,
I need assistance with separating out a cell array consisting of text labels within each cell based on the label. I have tried the findgroups function, but I would like to have the labels remain for further operations instead of the generated numbers for the labels (for example, I'd want to work with group "bicep" instead of group "1"). If I am misunderstanding how findgroups works and that is a possible outcome with that function, please explain how, as I am still new to Matlab.
Secondly, once those cells are separated based on the label, I need some way to go through all of the groups separately with a function (in this case, a mean of the unique values in corresponding cells). I understand how to do the function if all values were in the same group, but I am confused if working with numerous groups at the same time.
If there's anything else needed to help with my case, please ask and I can give more information. Thank you. (see comments)
6 Comments
Azzi Abdelmalek
on 8 Jul 2016
Your question is not precise.
Brian Tomblin
on 8 Jul 2016
Edited: Brian Tomblin
on 8 Jul 2016
per isakson
on 10 Jul 2016
Edited: per isakson
on 10 Jul 2016
Could you provide a tiny example of input and required output.
Brian Tomblin
on 11 Jul 2016
Edited: per isakson
on 11 Jul 2016
per isakson
on 12 Jul 2016
Edited: per isakson
on 12 Jul 2016
"I'd want to work with group "bicep" instead of group "1""   means that you you want to use statements like
plot( ..., 'bicep' )
How large is the total dataset, typically?
Brian Tomblin
on 12 Jul 2016
Answers (1)
Image Analyst
on 10 Jul 2016
0 votes
Try the ismember() function. To get the means, you can use grpstats().
3 Comments
Brian Tomblin
on 11 Jul 2016
Brian Tomblin
on 11 Jul 2016
Edited: Brian Tomblin
on 11 Jul 2016
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!