data sorting for finding average and standard deviation
조회 수: 1 (최근 30일)
이전 댓글 표시
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
KALYAN ACHARJYA
2022년 11월 8일
편집: KALYAN ACHARJYA
2022년 11월 8일
Can you share the data in more simplify way ( Just sample data)?
답변 (1개)
Cris LaPierre
2022년 11월 8일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!