fsolve no solution found results
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Fernando
el 18 de Jul. de 2023
Comentada: Fernando
el 18 de Jul. de 2023
Hello,
I wanted to ask what does fsolve do after no solution has been found and it stops interating? Is the output the last iteration or does it output the initial conditions?
Also, is there a way when no solution has been found to tell it to output nothing, or for example an array of zeros?
Kind regards.
0 comentarios
Respuesta aceptada
Matt J
el 18 de Jul. de 2023
Editada: Matt J
el 18 de Jul. de 2023
Is the output the last iteration or does it output the initial conditions?
It is the last iteration, as you can easily test, .e.g.,
fsolve( @(x) x^2+1,10 )
Essentially, if no solution exists, fsolve can be thought of as a least squares solver.
Also, is there a way when no solution has been found to tell it to output nothing
No, but there is no reason why your code can't do its own post-assessment of the result after fsolve completes.
Más respuestas (1)
Chunru
el 18 de Jul. de 2023
doc fsolve for more details.
[x, fval, exitflag, output] = fsolve() % check out exitflag and output
0 comentarios
Ver también
Categorías
Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!