Difference between successive rows in a column
조회 수: 5 (최근 30일)
이전 댓글 표시
I have a table with 60 columns and 60,000 rows. I want to find the difference of second row and first row of 40th column, then difference between 3rd and 2nd row, 4th and 3rd row, etc. It goes until it reaches he last row. Also, I need to assign those difference values in the 61st column. Please help me with this.
댓글 수: 0
답변 (1개)
Fangjun Jiang
2022년 8월 5일
편집: Fangjun Jiang
2022년 8월 5일
a=magic(6);
b=diff(a(:,4))
a(2:end,end+1)=b
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!