Integral of a Matrix Issue
Show older comments
Dear all, i'm trying to integrate a matrix to get a radial average mean temperature along three axial positions; however the codes always return the same matrix vlaue, instead of a single T mean value along axial site..
Does anyone know how could i get a real mean temperature value at each axial dirctection?
r=[0,5,10,15]
T=[300,310,320,335;
302,312,322,337;
305,315,325,340;] % as matrix 3*4
R_t=15 % radius
T*r'
fun=@(r)T*r'
integral(fun,0,r_t,'ArrayValued',true)
T_mean=(2./(r_t).^2).*integral(fun,0,r_t,'ArrayValued',true)
The output:
T = 3×4
300 310 320 335
302 312 322 337
305 315 325 340
T*r':
ans = 3×1
9775
9835
9925
integral(fun,0,r_t,'ArrayValued',true):
ans = 3×4
1.0e+04 *
3.3750 3.4875 3.6000 3.7687
3.3975 3.5100 3.6225 3.7912
3.4312 3.5437 3.6562 3.8250
T_mean=(2./(r_t).^2).*integral(fun,0,r_t,'ArrayValued',true):
T_mean = 3×4
300.0000 310.0000 320.0000 335.0000
302.0000 312.0000 322.0000 337.0000
305.0000 315.0000 325.0000 340.0000
Thanks in advnce!!!!
Accepted Answer
More Answers (0)
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!
