MATLAB: Unable to call function in script

functionscript

I am using Win 10. I have included the folder where my scripts are via Set Path.
Here is an example:
In file InitializeNetwork.m, I have this function:
function nn = InitializeNetwork(architecture) % line #10
… …
end
================================
From matlab R017a command line, I did these:
>> architecture=[336 100 20];
>> nn = InitializeNetwork(architecture);
Error: File: InitializeNetwork.m Line: 10 Column: 15
Function with duplicate name "InitializeNetwork" cannot be defined.
======================================
Please advice. Thank you.

Best Answer

Answer to self:
The error was due to inserted test code at begin of file in the same script which calls that function. It appears one cannot call the function within the same script.
Error also occurs when you place code below the function you want to call.
Thank you everybody for helping.
Related Question