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!