varfun for a cell array?
이전 댓글 표시
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
Adam Danz
2020년 3월 31일
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
2020년 3월 31일
Guillaume
2020년 3월 31일
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
2020년 3월 31일
I believe OP has a 300x1 cell array where each element is one of these tables. Good call with groupfilter.
Angelavtc
2020년 4월 1일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!