Solving an equation multiple times using a for loop
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Bob Thompson
el 30 de Abr. de 2019
Is the vpasolve coming up with a set of answers? That would be my first thought to check.
Respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!