Hello,
I am attempting to perform an integration using the following formulas:
strain = @(x) (eb-et)/h*x+et;Cstress = @(x) -Cf*(2*strain(x)/Cec-(strain(x)/Cec).^2);Cforcef = @(x) Cphi*b*Cstress(x)/1000;Cmomentf = @(x) Cforcef(x)*(h/2-x)/1000;
All variables are defined except for x. I then perform the following integration:
Caxial = integral(Cforcef,0,limit);Cmoment = integral(Cmomentf,0,limit);
The first one (Caxial) works fine, however the second (Cmoment) gives me the following error:
Error using * Inner matrix dimensions must agree.Error in @(x)Cphi*b*Cstress(x)*(h/2-x)/1000Error in integralCalc/iterateScalarValued (line 314) fx = FUN(t);Error in integralCalc/vadapt (line 133) [q,errbnd] = iterateScalarValued(u,tinterval,pathlen);Error in integralCalc (line 76) [q,errbnd] = vadapt(@AtoBInvTransform,interval);Error in integral (line 89)Q = integralCalc(fun,a,b,opstruct);
Does anyone know why this is?
Thank you for your help!
Best Answer