Create a difference loop from a cumulative matrix
显示 更早的评论
Hello
I have this data filed that I imported into a 831x1 matrix. The numbers in it are cumulative so I need to create a for loop that shows the difference between the row and the one before it so that I can have the pure added quantity in each row. If possible, I would like the first row to stay the same as it was in the imported file.
How do I do this?
4 个评论
madhan ravi
2019-4-8
diff(matrix) % ?
Mohamed Amine Mouajib
2019-4-8
madhan ravi
2019-4-8
Why are you sticking with a loop , is it your homework?
Mohamed Amine Mouajib
2019-4-8
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!