Difference between successive rows in a column
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Fangjun Jiang
le 5 Août 2022
Modifié(e) : Fangjun Jiang
le 5 Août 2022
a=magic(6);
b=diff(a(:,4))
a(2:end,end+1)=b
0 commentaires
Voir également
Catégories
En savoir plus sur Tables dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!