data sorting for finding average and standard deviation
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have a .csv file that contains data for different speakers (s1, s2, s3, s4,s 5, s6, and s8) and words (a and i). Please see attached the input.csv. I want to create a .csv file that will calculate the average and standard deviation for each speaker and word and save it as my output.csv. Please note that the no. of repetitions of each speaker is different. It contains five repetitions but can vary. The output.csv is attached the way I want to sort out the data. The 1st block contains the average of the data for word a, the second block contains the standard deviation for word a, the third block contains the average for word i, and the fourth block contains the standard deviation for word b.
Any helpor suggestions would really be helpful.
Thanks
2 comentarios
KALYAN ACHARJYA
el 8 de Nov. de 2022
Editada: KALYAN ACHARJYA
el 8 de Nov. de 2022
Can you share the data in more simplify way ( Just sample data)?
Respuestas (1)
Cris LaPierre
el 8 de Nov. de 2022
I would look into using groupsummary. I'll let you worry about getting the output formatted the way you want, but here's how I would do it.
file = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1185463/input.csv';
in = readtable(file, ReadVariableNames=true)
out = groupsummary(in,["word","speaker"],["mean","std"],["x0" "x25" "x50" "x75" "x100" "x_10"])
0 comentarios
Ver también
Categorías
Más información sobre Shifting and Sorting Matrices 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!