How to get the average of a subset of data in a matrix?
이전 댓글 표시
I am having some difficulty finding the average of some subsets of data. For example, given the following matrix:
ItemA 7
ItemA 8
ItemA 9
ItemB 10
ItemB 12
ItemB 14
ItemC 8
ItemC 16
ItemC 0
Given the above data, I would like to find the average of item A, B, and C individually. So it should return that Item A the average is 8, Item B the average is 12, and item C the average is 8.
The above data is just an example, the actual data is many more items so I need it to work for an unknown amount of items.
If you have any questions feel free to ask,
Thanks
댓글 수: 7
Image Analyst
2013년 11월 5일
What form is the data in? Is it a N by 2 cell array, where the first column is the itemX word and the second column is the number?
Aaron
2013년 11월 5일
Aaron
2013년 11월 5일
Image Analyst
2013년 11월 5일
I don't understand how kmeans comes into this. For each number in either column 2 or column 3 you know the category (A, B, or C) it falls into. So what is there to do with kmeans? How can you cluster/classify this data when it already is clustered/categorized? You can do the mean of each category - no problem with that - but kmeans???? I don't know how or why that would apply.
Aaron
2013년 11월 5일
Aaron
2013년 11월 5일
Aaron
2013년 11월 5일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!