MATLAB: Error when using ‘Run Section’

MATLABrun section

I get the following error whenever I click on Run section.
If i run the entire script the it works fine.
If i select individual snipets of code then it still works fine. Only run section produces this error. The same error no matter hat code i am runnng.
I have windows 10 and MATLAB 2020a.
P.S. I have 2020a installed on my other computers and they work just fine.
the problem is only on this computer. I installed MATLAB two weeks ago and the probem is since the starting.
Error using randi
Invalid default value for property 'Salt' in class 'matlab.internal.editor.eval.TempFolder':
Too many input arguments.
Error in matlab.internal.editor.eval.FileInfo
Error in matlab.internal.editor.eval.TmpFilePath.get
Error in matlab.internal.editor.evaluateCode
Error in matlab.internal.editor.evaluateCode

Best Answer

Remove the randi function here from your path:
C:\Users\maris\Desktop\Bachelor Thesis\mvgc_v1.0\mvgc_v1.0\utils\legacy\randi\randi.m
Either rename the file, delete it, or remove the folder from your path.
For an explanation of why it is a bad habit to shadow the names of internal functions, see this thread. As you see, stuff tends to break at some point.