I am trying to find the summation!!

My equation is
I = sum(delta t)
delta t = t(n+1) - t(n)
n=200;
could anyone help me to understand what is happening here if I am trying to get the result and what is the correct code for doing that please?
Thank you.

3 Comments

Maybe I’m missing something, but if you’re summing the differences in t, isn’t that simply:
I = t(end)-t(1)
Several people have said that. But if you look at the comments made by Avan, you will see that the expressions of interest are not really as written in the question.

Sign in to comment.

Answers (2)

Image Analyst
Image Analyst on 26 Aug 2014
I don't know what result you want, but I do know that variable names cannot have spaces in them. It thinks they're two separate variables.

4 Comments

Thanks for your comment and yes we can use ''dt'' instead of ''delta t''
What I am trying to do here is :
I have a system of two competing species y0 and y1, I am trying to apply the Fisher Information which the formula is :
I = A*sum(dt)^2*a
A=positive constant
dt=t(n+1)-t(n)
a= it is a long equation with constant parameters
My goal is to find the numerical solution for this equation I.
Hmm. I'm not sure if we have enough information to help you out.
I also would have pointed out just the veriable name issue.
Is dt already solved for and is 1 number? Is dt an array of numbers stemming from multiple iterations of that formula? What is the error message you receive if you get one?
What about
dt = diff(t);
I = A*sum(dt)^2*a;
:) How about I = A*(t(end)-t(1))^(2*a). If this does not answer your question, please provide some more information about what you want to accomplish. It seems that there are some integration steps here that have not been explained properly.

Sign in to comment.

John D'Errico
John D'Errico on 26 Aug 2014
Edited: John D'Errico on 26 Aug 2014
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
I = A*a*sum(diff(t).^2);
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:
I = A*sum(dt)^2*a
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.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 26 Aug 2014

Commented:

on 26 Aug 2014

Community Treasure Hunt

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

Start Hunting!