MATLAB: Does EVAL function with output arguments work in MATLAB 7.0.1 (R14SP1) but not in later versions when the name of a function is not a case-sensitive match for the name of the function a with .m extension

caseMATLABsensitive

I create the following function and save it as define.m
function [s_a,s_b] = Define(a)
s_a=a;
s_b=a;
When I execute the following command in MATLAB 7.1 (R14SP3) and MATLAB 7.0.4 (R14SP2):
[a,b]=eval(['Define(10)'])
I receive the following error:
??? Error using ==> eval
One or more output arguments not assigned during call to "eval"
But when I execute:
eval(['Define(10)'])
It works and I obtain the following result:
ans=10;
When I try:
[a,b]=eval(['Define(10)'])
In MATLAB 7.0.1 (R14SP1) it works fine with the following warning message:
Warning: Could not find an exact (case-sensitive) match for 'Define'. ...\define.m is a case-insensitive match and will be used instead. You can improve the performance of your code by using exact name matches and we therefore recommend that you update your usage accordingly. Alternatively, you can disable this warning using warning('off','MATLAB:dispatcher:InexactMatch').

Best Answer

To work around this issue:
Save the function as Define.m and not define.m. The name of a function, as defined in the first line of the file, should be the same as the name of the function file with the .m extension.
Refer to link below for more information on functions: