HOW DO I USE AVERAGEIF(excel) IN MATLAB?
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sara Hill Osorio
am 7 Okt. 2021
Kommentiert: Sara Hill Osorio
am 8 Okt. 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 Kommentare
Akzeptierte Antwort
Star Strider
am 7 Okt. 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 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Tables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!