Hello,
I'm certainly not the first to ask such kind of question, but I can't find appropriate answer...
I'm trying to make a sum of vector elements with symbolic indexes. The sum will then be differentiated in order to find the maximum of it. Here is the "code":
function kd = est(y, p, D)
K0 = size(p,2);
Kp = (size(y,2) - K0)/2;
syms m;
som = 0;
for k=1:Kp-D
val = y(k+m+D+K0)*conj(y(k+m+D+K0))*conj(p(k+D))*p(k);
som = som+val;
end;
Rd(m) = abs(1/(Kp-D)*som);
kd = solve(diff(Rd(m)));
end
y and p are known vectors and D is a scalar. For the moment, the error occurs in the for-loop, stating that "Indexing input must be numeric, logical or ':'."
If I try using the function_handle syntax, then the error occurs when assigning Rd(m)...
Any suggestion would be appreciated.