How to seperate table in octave

조회 수: 11 (최근 30일)
Parvathy ravindranath
Parvathy ravindranath 2020년 11월 14일
댓글: Parvathy ravindranath 2020년 11월 14일
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.

답변 (1개)

Ameer Hamza
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
  댓글 수: 1
Parvathy ravindranath
Parvathy ravindranath 2020년 11월 14일
thankyou for your answer.I have tried it but getting an error as this;-
>> parvathy_7
error: 'groupsummary' undefined near line 4 column 3
error: called from
parvathy_7 at line 4 column 2
i think octave doesn't have an inbuilt command 'groupsummary' or 'findgroup'.
is there any other method to do this

댓글을 달려면 로그인하십시오.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by