How do I subtract elements in array? (1 x 40)
显示 更早的评论
For example:
A = [8 3 10 7 15 12 16 14 20 18 12 8]
so that I can create two variables that are the difference between each pair in the vector..
result1 = [5 3 2] --> "[(8-3) (15-12) (20-18]"
result2 = [3 2 4] --> "[(10-7) (16-14) (12-8)]"
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!