MATLAB: Is exist(variable,’var’) not seeing a variable

existvariables

I have a function to which a variable is passed. The variable exists:
'signedOrNot = signed'
When I call 'exist signedOrNot var' it is found:
ans = 1
But when I use exist(signedOrNot,'var'), as I would in an if statement, it is not:
ans = 0
Any thoughts?

Best Answer

exist('signedOrNot','var')