varfun for a cell array?
Ältere Kommentare anzeigen
Is there a way to apply varfun(@mean,A,'GroupingVariable','VariableX')to all the elements that are contained into a cell array? If yes, how?
Thanks a lot!
5 Kommentare
Adam Danz
am 31 Mär. 2020
Short answer: no.
But there are other ways to achieve your goal.
Please provide samples of your data so we can see what your cell array looks like, what's stored in it, it's shape, and the grouping variable.
Angelavtc
am 31 Mär. 2020
Guillaume
am 31 Mär. 2020
I'm a bit confused by the description, there's no cell array in your example.
Note that "keep just the values where the GroupCount=2" is achieved in one line with groupfilter instead of varfun.
Adam Danz
am 31 Mär. 2020
I believe OP has a 300x1 cell array where each element is one of these tables. Good call with groupfilter.
Angelavtc
am 1 Apr. 2020
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Tables finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!