Adding Array elements from one element to another

조회 수: 1 (최근 30일)
Charith Ranatunga
Charith Ranatunga 2020년 3월 31일
댓글: Charith Ranatunga 2020년 3월 31일
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

채택된 답변

KSSV
KSSV 2020년 3월 31일
Let A be your array.
iwant = sum(A(487146:513795)) ;
  댓글 수: 1
Charith Ranatunga
Charith Ranatunga 2020년 3월 31일
Sweet thank you, I got it working I just used the 'abs' function cause I got a negative total power value between those elements

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by