![image.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/245721/image.png)
How to check the internal solution results of Fsolve to know where the matrix dimension assignment has problem?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
farzad
el 30 de Oct. de 2019
Hi All
I am solving a set of 2nd order equations via fsolve. But it seems like that already in the first equation I have got a problem. and I get the following error. the fsolve was working on a previous set of equations. but now just having change some parameters, I see the following error.
I need to know if there is any way to monitor the real time solution results to see where this problem arises? I see that even x is not defined here yet, since this error comes before.
In an assignment A(:) = B, the number of elements in A and B must be the same.
Error in root2d (line 30)
F(1) = my equation;
Error in fsolve (line 230)
fuser = feval(funfcn{3},x,varargin{:});
Error in Fsolver (line 167)
[x,fval,exitflag,output] = fsolve(fun,x0init,options);
Caused by:
Failure in initial objective function evaluation. FSOLVE cannot continue.
0 comentarios
Respuesta aceptada
Matt J
el 30 de Oct. de 2019
Editada: Matt J
el 30 de Oct. de 2019
Yes, if you re-run your code after executing
>> dbstop if caught error
at the command line, the code will pause execution at the point which triggered your error. If needed, you can also navigate to the workspace of other functions in the chain of function calls that caused the error using the Function Call Stack dropdown:
![image.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/245721/image.png)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Systems of Nonlinear Equations 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!