I would like to get an example of the difference between the maximum and minimum values by grouping grpstats or looping statements
이전 댓글 표시
Hello! I have a large Matlab dataset, the dataset formats are as following example:
id1 id2 value
148 168 80
148 168 82
148 168 96
568 566 66
568 566 28
568 566 88
568 566 62
166 688 88
166 688 82
......
Now I want each set of the same (id1,id2) will get a corresponding difference between the maximum value and the minimum value, for example:
id1 id2 diff
148 168 16
568 566 60
166 688 6
......
How can I get the results like this by using grpstats or looping statements? Thanks!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!