Clear Filters
Clear Filters

Having trouble with integral and matrix range.

1 view (last 30 days)
I need to calculate the integral fo Fo value (wich is used in food industry for determining if sterilization or pasteurization was complete).
Fo = INT(10^((T(t)-Tr)/z)*dt),0,time)
in which:
Tr,z = constants
T = matrix, in this form:
16 17 18 19 20.....
time = matrix, just like T matrix:
5 6 7 8....
How can i accomplish this integral? I have to calculate it numerically with this values, but i don't find how :(
Also, within my programming i get a matrix which is always ONE cell longer than all the other arrays (matlab always goes +1 for the calculation, so i get a longer array). I need to program that this doesn't happen, so i can plot this matrices (which now i can't, because of the different ranges of the arrays. i have to erase the last cell manually)
Help please :(
Best regards

Answers (1)

Walter Roberson
Walter Roberson on 7 Nov 2011
Your derivative indicator, dt, is only meaningful if t is continuous. If your T(t) term indicates indexing, then your t needs to be discrete positive integers.
If you were to modify the expression to
Fo = integral of 10^((T*t-Tr)/z)*dt over t = 0 to time
[since a(b) might mean a*(b) which would normally be written a*b unless b is an expression] then you have two difficulties: that T is a vector, and that time is a vector.
Perhaps you want to define,
Fo(k) = integral of 10^((T(k)-Tr)/z)*dt over t = 0 to time(k)
where in that line (k) indicates indexing at offset k.
If that is what you want, then the answer becomes trivial:
Fo(k) = 10^((T(k)-Tr)/z) * time(k)
since in that circumstance 10^((T(k)-Tr)/z) would simply be a constant for the purposes of integration.
For the second part of your question about an output that is too long, we would need to see code.
  2 Comments
Walter Manns
Walter Manns on 7 Nov 2011
What i'm asking in the second part, is just this:
How can i, with a command/function, transform this matrix:
A = [1 2 3 4 5]
to this one:
A' = [1 2 3 4]
Just erase the last cell.
Regards :D
Walter Roberson
Walter Roberson on 7 Nov 2011
A(1:end-1)
However, it would be better to construct the code so that the extra value was not generated, if possible. (It isn't always possible, but it is more often than not.)

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!