MATLAB Answers

Adding Array elements from one element to another

2 views (last 30 days)
I have an array that contains all of my power values in dBm from a LoRa signal. I found the 10dB bandwidth (BW) but I want to add the elements from one point in the array to another point.
My array has 1,000,000 elements and I want to add the elements from element 487146 to element 513795 in my array to find the total power im looking for. What advice could you give? I have tried sum but not sure have to implement it in this case

  0 Comments

Sign in to comment.

Accepted Answer

KSSV
KSSV on 31 Mar 2020
Let A be your array.
iwant = sum(A(487146:513795)) ;

  1 Comment

Charith Ranatunga
Charith Ranatunga on 31 Mar 2020
Sweet thank you, I got it working I just used the 'abs' function cause I got a negative total power value between those elements

Sign in to comment.

More Answers (0)

Sign in to answer this question.