Why does solve function return an empty value in a for cycle?
Show older comments

for i=1:N
syms Tout
sol=solve (energy_balance,Tout,'Real',true, 'IgnoreAnalyticConstraints',true);
T_gp_out(i)=double(sol);
end
Solve function returns an empty value at the second iteration of the for cycle which i am using.
When the solve function is run separately outside the for cycle it returns a real value.
I can't understand what is going wrong when all inputs and syntax are correct.
Should I define a syms vector function outside the for cycle?
Can someone help me?
Thanks in advance.
Giorgio Ceresoli
3 Comments
darova
on 29 May 2020
Show energy_balance function
Giorgio Ceresoli
on 29 May 2020
Giorgio Ceresoli
on 29 May 2020
Accepted Answer
More Answers (0)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!