integral function gives error
이전 댓글 표시
R = 8.3145;
rxnH1500 = deltaHrxn + integral(deltaCpfxn, 298, 1500)
KaIntegralFunc = @(T) rxnH1500/(R*(T^2))
integral(KaIntegralFunc, 0, 1)
Running this code gives a long error message with
----
"Error using ^
One argument must be a square matrix and the other must be a scalar. Use POWER (.^) for elementwise power.
Error in cheg325hw8q2>@(T)rxnH1500/(R*(T^2))
fx = FUN(t);
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
Q = integralCalc(fun,a,b,opstruct);"
----
I don't understand why the integral didn't work, as the function works just fine.
답변 (1개)
Star Strider
2020년 5월 7일
do not see the function that is being integrated anywhere in your Question. However the error message tells you exactly what to do:
Use POWER (.^) for elementwise power.
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!