Argh. I was trying to read your question to answer it. It made no sense at all, since your expression for I was completely wrong in the question you posed. Only in the comment to Image's answer do we see any clue. There we find MOST of what we need to compute the sum you wish to form. Maybe.
So A is a constant, and is irrelevant, unless there is something else you have not told us.
a however, is apparently crucial, and you tell us only that it is a long equation. So how can we possibly help you? We don't know what a is. Is it a function of n? Of what? If it is truly constant, then factor it out, and you have a simple sum.
What is the sum? The sum is apparently just a sum of squared differences of the vector t. Of course, you don't tell us what t is. I'm guessing that t is a known vector of length n. Or maybe not, and you have kept something else in the shadows. Is a maybe a function of t?
So MAYBE the answer is just
Or maybe not. The point is, you have offered insufficient information here, only doling it out in dribs and drabs when pressed for more. You have used non-standard terminology, partial pseudo-code certainly inconsistent with MATLAB notation.
Some of the things that are still unclear to me are in the pseudo-expression as you have written it in a comment:
If sum is the MATLAB sum function, then sum(dt) seems to reduce trivially to t(end)-t(1). But are you squaring those terms or are you squaring the full sum? Or are you raising each term to the power (2*a)?
BE CLEAR ABOUT YOUR QUESTION. At least if you want a useful answer that does not involve wild guesses on our part. Often a theme is that when one cannot be clear about a question, it means that the person does not themselves really understand what it is they need to do. And if you cannot explain it clearly, then we certainly cannot help you.