Here is the equation I'm going to solve.
where epsilon is a variable.
I wrote the following code.
r = 1:(2^h)-1;
v = 1:h-1
T = exp(x*h/1000)+sum(exp((x/1000)*(cos(2*pi*r/(2^h))+cos(2*pi*r*(2^v)/(2^h)))));
I can run the code when h=2; however, when h becomes greater than or equal to 3, an error that input must be a scalar and a square matrix shows up.
Could anyone please help me on this error?