I think the most straight forward would be to use Mathematica packages and importing the definitions in that notebook using the function Get
as Szabolcs mentioned in the comments. I suggest that you have a closer look at the documentation on how to set up packages in Mathematica. Th principle is quite simple to understand.
Here is a small example of how you can set up a package. You first define your package and its context which is called functions in this case. Save the file as a Mathematica package file (.m). If you want to make a function to be available for other packages and notebooks, you can define a usage for that function in the exported symbols region. This will ensure that this function is available in the global context.
(* Mathematica Package *)
BeginPackage["functions`"]
(* Exported symbols added here with SymbolName::usage *)
myAdd::usage="
myAdd[x0_,y0_]
computes z=x0+y0 and returns the result.
";
Begin["`Private`"] (* Begin Private Context *)
myAdd[x0_,y0_]:=
Module[{z},
z=x0+y0
]
End[] (* End Private Context *)
EndPackage[]
You can then import the content of your package with the function Get
and make the functions available in your Mathematica session. This will evaluate the definitions you made in the package functions will be available and you can use them.
Get["...pathToPackage...\\functions.m"]
By the way I recommend to not define functions that start with capital letters. All built-in functions start with capital letters and you might run into conflicts you don't want. Also you should have another look at local variables and the usage of Modules.
Get
? $\endgroup$function.m
or you need to change the working directory to wherefunction.m
is first. The working directory is not the same as the notebook directory. It is given byDirectory[]
. It can be changed bySetDirectory[]
.SetDirectory@NotebookDirectory[]
changes the working directory to the notebook directory (if the notebook is saved on disk). $\endgroup$