I'm using the 'assignin' function to assign a value to the variable 'max' using the code below:
If I run 'get_data' from the command line, I get an error that I'm not passing enough input arguments to 'max,' since 'max' is a built-in function to MATLAB.
Interestingly, I can add the output 'max' to the function 'get_data' by writing
and the function will run and display the value '5'.
My questions are:
1) Is this how 'assignin' is supposed to behave, i.e. does it not assign a value to a variable if the variable name is an instrinsic function in MATLAB?
2) Why is 'assignin' not able to assign value to 'max,' but I can execute 'max=5' in other contexts and MATLAB won't complain?