How do I subtract elements in array? (1 x 40)
Show older comments
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)]"
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!