How to mean data of second column with respect to the similar element in the first column
1 次查看(过去 30 天)
显示 更早的评论
Dear All,
I have a data array with two column. The first array is contain repeated values of different order and the second column contain the respective data. I need to mean elements in second column which has same value in the first column. Example of data pic attached hereby. According to the figure i need to mean only values of column two correspond to 0, 0.016667 and so on. Thank you in advance
0 个评论
回答(4 个)
Cris LaPierre
2022-11-14
编辑:Cris LaPierre
2022-11-14
Use groupsummary or grpstats. Group on column A, and set the 'method' to 'mean', and set the datavars to column B.
If you import you data to a table, use this syntax:
If your data is in vectors, use this syntax
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!