HOW DO I USE AVERAGEIF(excel) IN MATLAB?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sara Hill Osorio
el 7 de Oct. de 2021
Comentada: Sara Hill Osorio
el 8 de Oct. de 2021
Hello, so I am new to Matlab and I am doing a project where I have to find the average of my column "weights" depending on the column "sex". So it is pretty much finsing the average weight of males and females. This is how the table looks like :
2 comentarios
Respuesta aceptada
Star Strider
el 7 de Oct. de 2021
g = {'Male';'Female'};
allSamples = table(randi([60 99],20,1),randi([160 210],20,1),g(randi([1,2],20,1)), 'VariableNames',{'Weight','Height','Sex'})
G = groupsummary(allSamples, 'Sex','mean','Weight')
.
0 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Tables en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!