Writing and applying user-supplied functions
In Chapter 3, we saw how to "build" mathematical functions directly via the Octave command prompt. Here we will do the same thing, but we will do it properly this time and use Octave functions.
Consider the following vector valued function which we will call the Sel'kov function (an explanation follows later):
b is some positive real number that we can vary as we like. We can write Equation (5.1) in a slightly different way by letting (x,y)=(x1,x2)=x:
When we write an Octave function for Equation (5.2), we can specify the value of b in at least three different ways:
1. We can simply set the value of b inside the function (inside the function scope)
2. We can let b be input to the function
3. We can let b be a global variable such that its value is accessible from both the workspace and inside the function scope
The first option is a bad choice, because we then have to change the value of b inside inside the function every time we need to change...