Check for missing argument or incorrect argument data type in call to function 'int'.
显示 更早的评论
I have an issue with performing ode45 when my function has an integral. I wish to integrate a function with one of my input variables defined for my function, but Matlab wants me to use syms to define the variable. Is there a way I can work around this issue? Any help is appreciated and thank you for your time.
function g = odefunction(t,p)
T = p(1); C = p(2);
Cp = (3.5*8.314)+(((1200/T)^2)*8.314*exp(1200/T)/((exp(1200/T)-1)^2));
Q = int(Cp,[298 T]); %Error message on this line
dTdt = ((10*Q)+(1000*(4.518*10^-8*exp(-100/(8.314*T)))))/100;
dCdt = 4-C+(4.518*10^-8*exp(-100/(8.314*T)));
g = [dTdt; dCdt];
%Script
tspan = [0 24];
initial = [298 5];
[t p] = ode45(@odefunction,tspan,initial);
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!