I do not know if its a symsum function i have to use

 Accepted Answer

It looks to me as if it is likely that q and t represent vectors that are being indexed. You cannot use symsum() to index a vector. Instead use,
N = n+1;
j = (1:n) + 1;
XF = sum((q(j) - q(j-1)) / q(N) .* log(t(N) - t(j-1)));
The N = n+1 instead of n is present because the formula uses j = 1 : n and which would be when j = 1. MATLAB cannot index by 0, so we need to add 1 to each subscript.
Your tags mention integration, but this does not look like integration to me -- not unless it is Reimann integral of log(t_n - t) with independent variable stored in q ? Trapazoid calculations are generally more accurate than Reimann integral.

More Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!