Trying to call ode45 - Undefined function or variable

I wrote a function that will be integrated with the ode45 command. I'm having trouble with a variable in the function. I do not have the variable defined in the function, but it is defined in another script, where I'm trying to call ode45 on the function in that script, but it's saying that the variable is undefined. Anyone have any ideas how I could call ode45 on a function with a variable defined somewhere else?

Answers (2)

I just attempted to use a nested function, but it's introducing the same problem because my script also calls on variables from another script, so that if I put it into its own function, the variables in that script will be undefined.

Categories

Find more on Programming in Help Center and File Exchange

Asked:

on 4 May 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!