Defining mathematical functions with summation in Octave
<p>I want to define the  mathematical function sum(x^z)+z  where x ranges from 1:10 and z is a variable</p>

<p>One way I tried is </p>

<pre><code>syms z
f=@(z)(z)
for i=1:10
    f=f+(i.^z)
end
</code></pre>

<p>But this leads to a error:   binary operator '+' not implemented for 'function handle' by 'matrix' operations</p>

<p>I also tried to define a function initially of two variables x and z as</p>

<pre><code>syms x
syms z
f(x,z)=z+(x.^z)
sum(f([1:10,z]))
</code></pre>

<p>It also gives error</p>

<p>Please tell me the correct method to do this. </p>