Hello everyone,
I am working to make simlabel compatible with EasySpin 6.0.0...
I am facing a problem with esfit that was not present with previous eayspins.
Basically I try to use esfit with automatically generated functions and the problem is :
Error using esfit
The simulation/model function given as second input cannot be found. Check the name.
You can find attached a code facing this problem. Note that the purpose of this code is just to illustrate this problem as simply as possible.
When running the code, be sure that 'temporary_func4esfit.m' is generated by the code and was not present in the current directory.
I am not able to reproduce this problem. It happens 1 out of 10 times, and I haven't been able to identify the problem.
esfit calls isa(fcn,'function_handle) first to make sure the supplied argument is a function handle, and then it calls nargin(fcn) to determine whether the function can be found. The latter appears to fail in your case. Maybe experiment with this. There could be some latency between your function generation and when MATLAB updates its internal list of callable functions.