MathWorks Interview Question

What would be called if you have a variable 'x' in your workspace in MATLAB and a function 'x' stored in the MATLAB directory when you type 'x' in the command window?

Interview Answers

Anonymous

Aug 9, 2011

the variable will be called as it is stored in the workspace, function names are never stored in workspace!

10

Anonymous

Aug 4, 2011

if x is in current working directory, MATLAB will complain about the conflict and produce an error. In this case eval function comes in handy to distinguish two x's

1