Error in Intergral with error matrix dimensions must agree.

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.

 采纳的回答

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by