I have a function in Matlab that finds the roots of a system of nonlinear equations. It calls for the system function, which is unique to each nonlinear system that I am trying to solve.(adsbygoogle = window.adsbygoogle || []).push({});

What I am trying to do is write a code that uses my root function to solve my system function. However, I also want the user to input the values of the constants in the system equations. If I write that in the system function, with each iteration that the root function does, I have to enter them again. That gets quite tiring.

I guess my question is, is there a trick to set the inputs of the systems function and have them used for every iteration in the root function?

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# How do I use the same user input for every iteration?

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**