From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate the summation of each M elements of N dimention array ?

Hi guys,

I need some help for the fastest way to get the summation of each K elements of N dimention array (for example, the sum of each 10 element of 683 array)

The following program is where I want to use this summation (the array 'd' has a size of 683)

for i=k+1:683-k

    sumd=0;

    for j=1:k

        sumd=sumd-1/d(i-k)+1/d(i+k);

    end

    AD(i)=d(i)*(sumd+1/d(i));

   

end

Thank you

0 Kudos
Message 1 of 1
(2,492 Views)