Mahus
Mahus

Reputation: 607

For loop feeding constant values into fsolve in matlab

I am trying to use matlab's fsolve to solve a system of 4 nonlinear equations. I'm solving the system for each point in a grid of parameters by looping through each point and calling the fsolve function.

My problem is that I need to give some of these parameters as input to fsolve. These inputs should be treated as constants for each separate solving of the system.

Can anyone help me?

Upvotes: 1

Views: 1209

Answers (1)

Jens
Jens

Reputation: 26

you can just do:

result = fsolve(@(x) eqns(a,b,c,d),guess)

and in addition make the function eqns() with your equation set.

Upvotes: 1

Related Questions