MATLAB: Compute triple summation for the homework

loopingsummation

hello guys
I have need to compute the following summation for my homework. Any hint or pseudo code would be helpful. Thanks.
Edit – "p" is a vector containing numbers and p(x) refers to the element position in that vector and "y" is a symbol

Best Answer

Since y is a symbol, you will need to use the Symbolic Toolbox.
You might be tempted to use symsum() for this, but symsum has the limitation that symbolic variables cannot be used for indexing of arrays.
So... ndgrid, calculate the formula for each point, and then sum() along the dimensions until you get a scalar result.
Related Question