Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Computing nested summation

  1. Jul 15, 2013 #1
    [itex]
    M_{K}=\frac{1}{2^{k+1}-2}\sum_{i=0}^{L-1}\sum_{l=1}^{K}\binom{K}{l}h_{i}i^{l}M_{K-l}
    [/itex]

    [itex]M_0=1[/itex] and the size of [itex]h_i[/itex] is [itex]L[/itex].

    I tried to compute this summation in matlab, my attempt is as following:
    Code (Text):
    clear
    h=[ (1+sqrt(3))/4 (3+sqrt(3))/4 (3-sqrt(3))/4 (1-sqrt(3))/4]';
    % for simplicity i take K=4 and L=4
    K=4;
    L=4;
    k=1;
    M=zeros(1,K+1);
    M(1)=1;

    for l=1:K
        for i=1:L
            for j=1:k
                M(l+1)=M(l+1)+nchoosek(k,j)*h(i)*((i-1)^l)*M(l);
            end
        end
        k=k+1;
        M(l+1)=(1/(2^(K+1)-2))*M(l+1);
    end
    But i'm not sure whether the codes are correct or not. If the codes are not correct how can i fix them?
     
  2. jcsd
  3. Jul 17, 2013 #2
    problem is solved.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Computing nested summation
  1. Matlab summations (Replies: 2)

  2. Matlab - Summation (Replies: 4)

Loading...