How to seperate table in octave
조회 수: 11 (최근 30일)
이전 댓글 표시
I am a newbie here. My table contains both string and numerical data regarding height of male and female individual.i wanted to seperate the data into male height and female height.how can i do this in octave.
댓글 수: 0
답변 (1개)
Ameer Hamza
2020년 11월 14일
편집: Ameer Hamza
2020년 11월 14일
Read about groupsummary(): https://www.mathworks.com/help/matlab/ref/double.groupsummary.html, especially check the first example on the documentation page.
If you want to create two tables then try something like this
T = table({'male', 'female', 'female', 'male', 'male'}.', rand(5,1), ...
'VariableNames', {'gender', 'height'});
grps = findgroups(T.gender);
n = max(grps);
Ts = cell(1, n);
for i = 1:n
Ts{i} = T(grps==i, :);
end
참고 항목
카테고리
Help Center 및 File Exchange에서 Octave에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!