How do i check the frequency of an element in a multi level cell array?
Show older comments
The multi level cell array has 61 cells and each of these 61 elements have around 25*30 cells.
7 Comments
Sindar
on 20 Jan 2020
Are the lowest-level cells all the same size?
Dinesh Yadav
on 23 Jan 2020
Edited: Dinesh Yadav
on 23 Jan 2020
Adding upon Sindar's question are datatypes of all elements same or they can be different? Can you share how your data looks like?
Prajwal Venkatesh
on 23 Jan 2020
Turlough Hughes
on 23 Jan 2020
Do you want to compare a given string with all strings in results2 or just the given first level cell? What do you want to do with that info?
Prajwal Venkatesh
on 23 Jan 2020
Turlough Hughes
on 23 Jan 2020
Is there a reason you need a new array with similar structure to results2? It'd probably be much easier to make a unique list of the strings and list the corresponding frequencies alongside them.
Secondly, it's worth confirming what Dinesh asked with the following code:
test = cellfun(@(x) cellfun(@class,x,'UniformOutput',false),results2,'UniformOutput',false);
unique(vertcat(test{:}))
Or better yet, attach results2, with the paperclip button.
Prajwal Venkatesh
on 23 Jan 2020
Accepted Answer
More Answers (0)
Categories
Find more on Matrices and Arrays 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!