Hi, I want to calculate the sum of some array elements in matlab by using if-or statement or by using any other code. My inputs are shown in below.
Deger Node1 Node2 20 1 2 25 2 5 27 5 6 28 6 7 31 7 4 32 4 3 33 3 2 34 3 6
I want to identify same values (max=7) in node1 and node 2 and calculate the sum of Deger values corresponding to that values. For example for 1, we have only 20 for değer. so value=20. For 2, we have 3 values 20,25,33. so the sum is 78. For 3, we have 32,33,34 so value=32+33+34=99. How can I wrote this code in matlab ? Thanks for your help.
Best Answer