My problem is, even though there is a local variable called 'mu', when code runs the command
sqrt(mu)
Matlab tries to run the internal function called mu.
As far as I know this is not a normal behaviour. How can I make Matlab to use the local variable over it's internal function?
I plan to compile this code with deploy tool, therefore modifying matlab's internal function file is not suitable. Problem will occur in complied version.
Let me give more detail about the problem,
My main.m file calls function_a.m function. Function_a function runs another script named, constants . Constants.m file is not a function but a script, it only keeps some variables so when its loaded it fills workspace with those variables. It's format is,
const1=3; const2=5; mu=2;
Right after function_a runs constant.m, it tries to use the mu value. This is when matlab gives an error from it's internal mu function. It means that Matlab does not use local mu variable which was created by contants.m.
I used debugger to stop the code after running constant.m but before using mu in a command. Mu is actually in work space as it should be. While in debug mode, if I use the command sqrt(mu), it works as it should be. But when I let continue to run, when same command is written in function file, Matlab gives the error that shows it is trying to use the internal function.
How can I fix this?