How to find splitapply for multiple values

조회 수: 1 (최근 30일)
Lakshita Lakshita
Lakshita Lakshita 2021년 2월 23일
댓글: Lakshita Lakshita 2021년 2월 23일
x=readtable('milgram’)
occage=findgroups(x.occupation,x.Age)
I want to find the distribution for both age and occupation
For occupation I have figured it out:
[occage, ID] =findgroups(x.occupation,x.Age)
occupation=[ID]
but Im stuck on age, how do I get the 'ID' for that/ how do I get the way the groups have been split for that?

채택된 답변

Matt J
Matt J 2021년 2월 23일
편집: Matt J 2021년 2월 23일
[G, idOcc,idAge] =findgroups(x.occupation,x.Age)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by