3

From time to time I have this problem with Matlab where I for example, create a variable named "max" and then get all kinds of weird errors when I try to use the function max() on something, since I overwrote the function by accident with my variable.

I have lost much time and my mind, and I find it awful that this is even possible.

I would like to know if there is a way to disable this behavior, so that function names are reserved like in many other languages and this cannot happen by mistake.

user985366
  • 1,635
  • 3
  • 18
  • 39

1 Answers1

3

From the looks of the documentation, you can't do that.

You should use exist <name> when in doubt to make sure that <name> won't override an existing function.

lsissoko
  • 91
  • 3