I define a function called f[x], which gives a numerical result interacting with an external free software called FEMM, using NETLink.
This function works properly and the following codes give the expected result:
I try to do some optimization using this function. In order to do that I use
But an error appears as below:
"error: attempt to perform arithmetic on global `x' (a nil value)".
What could be the cause of this problem?
Thanks for your help!