for loop – function handle is not converting – matlab

for loop – function handle is not converting – matlab

Just the relevant Part:

 Valor(1,1)=symfun(0,x);
 for i=1:c3
    Valor(i,1)=symfun(0,x);
    for j=1:r4
        Valor(i,1)=symfun( Valor(i,1)/(1+E(j,1)+x(j,1))^j+(B(i,j)/((1+E(j,1)+x(j,1))^j)),x);
    end
end

Valor needs to be predefinded as symbolic, with Valor(i,1)=0; you made it to a double.


Oh almost forgot, your solve needs to look like this:

[solx1,solx2,solx3,solx4, solx5, param, cond] = solve(eqn, x, ReturnConditions, true);

for loop – function handle is not converting – matlab

Leave a Reply

Your email address will not be published.