Background
I have recently turned on the M-Lint warning 'M-Lint cannot decide whether ... is a variable or a function and assumes it is a function' as per Is it possible to set matlab to validate reachable functions before running in order to try to detect misspelled variable names.
M-Lint was renamed to code analyser in recent versions of matlab but I am using Matlab2007b.
Question
All functions seem to be generating this warning, even those in the same m-file. For example in the below code needlessDelegate
generates this warning when used.
Is it possible to avoid this warning for valid functions? Or are my functions in some way incorrectly written?
function [biggest]=getBiggest(variable1, variable2)
biggest=needlessDelegate(variable1, variable2); %<-- needlessDelegate generates warning. 'M-Lint cannot decide whether <name> is a variable or a function and assumes it is a function'
end
function [biggest]=needlessDelegate(variable1, variable2)
if variable1>variable2,
biggest=variable1;
else
biggest=variable2;
end
end
'M-Lint cannot decide whether 'needlessDelegate' is a variable or a function and assumes it is a function'