Having trouble with integral and matrix range.
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Walter Roberson
2011-11-7
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 个评论
Walter Roberson
2011-11-7
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.)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!