Error in Intergral with error matrix dimensions must agree.
Show older comments
xbar = [0.2 0.4 0.6 0.8]; tbar = [0:0.001:2]; xsbar = 2.*tbar - tbar.^2;
for i=1:length(tbar) if xbar(1) <= xsbar(i) hbar(i) = ((xbar(1) - xsbar(i))^2)/ (9*(tbar(i)^2)); ubar(i) = (2/3)* (1 - 2*tbar(i) + (xbar(1)/tbar(i))); else hbar(i) = 0; ubar(i) = 0; end end v = length(hbar); fun = @(z) ubar(z); uavg = 1/hbar * integral(fun,0,v,'ArrayValued',true)
Error: Error using / Matrix dimensions must agree.
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!