integral function gives error

1 回表示 (過去 30 日間)
cmcelm
cmcelm 2020 年 5 月 7 日
回答済み: Star Strider 2020 年 5 月 7 日
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.
fx = FUN(t);
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 88)
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
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.

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by