HOW DO I USE AVERAGEIF(excel) IN MATLAB?
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Sara Hill Osorio
il 7 Ott 2021
Commentato: Sara Hill Osorio
il 8 Ott 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 :
Risposta accettata
Star Strider
il 7 Ott 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 Commenti
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Tables in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!