Variable amount of nested sums

So I've been trying to code this equation where F can be any function with k inputs, ,..., are the same for the same subscript and I have m and k as input. I've been struggling to get the nested sums and the way i managed it, is by creating k-many symbolic expressions and iterating over them while summing up k times with symsum, similiar as shown below ( Fk(x) equivalent to F(cos(x) ) where x is our vector with k entries.
The problem is mv(i) take the values 1 to m and I'm not sure how to modify my function so that I can do something like Fk(θ(mv)) because Fk(theta(mv)) doesn't work or similiar stuff.
startsum = Fk(mv)
for i = 1:k
startsum = symsum(startsum, mv(i),1,m)
end
end

类别

在 帮助中心 和 File Exchange 中查找有关 Function Creation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by