why is there a big difference between trapz and mean
Show older comments
Hello together, I have the following Problem:
my 2D Vector of a measured Temperatur is T_ZA1.
I Need the mean value, but if I calculate the mean value with:
T_mean_=mean(mean(T_ZA1))
the value is: 121.145.
When I calulate the mean value with trapz like:
T_mean_int=trapz(trapz(T_ZA1,2))/length(T_ZA1(:,1))/length(T_ZA1(:,:));
the value is 47.0566.
Why is this such a big difference? It is not plausible.
Can someone help me please?
Best regards
Accepted Answer
More Answers (2)
See what happens:
function main
A=[2 5; 3 6];
m11 = mean(A,1)
m12 = mean(m11)
m21 = trapz(A,1)
m22 = trapz(m21)
Best wishes
Torsten.
GUY Shareman
on 4 Jun 2018
0 votes
Categories
Find more on Numerical Integration and Differentiation 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!