Solving an equation multiple times using a for loop
11 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to solve the following equation for time (t) using different air temperatures. Matlab says that the solution is 0*1 empty double column vector!
Thank you for your help.
clear all
clc
x=1
for T_a_amb=[270.928:0.01:272.594] %ambient air temperature
syms t
a = -4/(T_a_amb-277);
b = 5.948e-5;
c = 0.00771;
eqn = 1-(exp(b*t)*(1-erf(c*sqrt(t)))) - a== 0; %
solution = double(vpasolve(eqn,t,[0,1]))
solmate(x,1) = T_a_amb;
solmat(x,2) = solution;
x = x+1
end
1 个评论
Bob Thompson
2019-4-30
Is the vpasolve coming up with a set of answers? That would be my first thought to check.
回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!