how to find difference between column elemnts in a matrix ?
Mostra commenti meno recenti
Let my matrix is
3 2 14 5
7 1 8 9
11 11 12 13
I need to find the substraction between column 1 and 2 and store the result in coulmn 1. similarily for coulmn 3 and 4 and result will be in coulmn 2. i.e the result should be like this
1 9
6 -1
0 -1
kindly, suggest solution. Thank you.
Risposta accettata
Più risposte (1)
Walter Roberson
il 13 Giu 2017
Result = YourMatrix(:,[1 3]) - YourMatrix(:,[2 4])
1 Commento
aditya sahu
il 13 Giu 2017
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!