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

2 comentarios

Rik
Rik el 25 de Ag. de 2020
What does which('randi','-all') return?
It returns the following:
>> which('randi','-all')
C:\Users\maris\Desktop\Bachelor Thesis\mvgc_v1.0\mvgc_v1.0\utils\legacy\randi\randi.m
C:\Program Files\MATLAB\R2020a\toolbox\matlab\randfun\@RandStream\randi.m % RandStream method
C:\Program Files\MATLAB\R2020a\toolbox\parallel\parallel\@codistributed\randi.m % codistributed method
C:\Program Files\MATLAB\R2020a\toolbox\parallel\parallel\@codistributor1d\randi.m % codistributor1d method
C:\Program Files\MATLAB\R2020a\toolbox\parallel\parallel\@codistributor2dbc\randi.m % codistributor2dbc method
C:\Program Files\MATLAB\R2020a\toolbox\parallel\parallel\@distributed\randi.m % distributed method
C:\Program Files\MATLAB\R2020a\toolbox\parallel\gpu\@gpuArray\randi.m % gpuArray method
built-in (C:\Program Files\MATLAB\R2020a\toolbox\matlab\randfun\randi) % Shadowed

Iniciar sesión para comentar.

 Respuesta aceptada

Rik
Rik el 25 de Ag. de 2020
Editada: Rik el 25 de Ag. de 2020

1 voto

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.

2 comentarios

I just removed the function from the path and this happened:
Error using matlab.internal.editor.eval.FileInfo
Invalid default value for property 'Salt' in class 'matlab.internal.editor.eval.TempFolder':
Previously accessible file "C:\Users\maris\Desktop\Bachelor Thesis\mvgc_v1.0\mvgc_v1.0\utils\legacy\randi\randi.m" is now inaccessible.
Error in matlab.internal.editor.eval.TmpFilePath.get
Error in matlab.internal.editor.evaluateCode
Error in matlab.internal.editor.evaluateCode
Aayush Marishi
Aayush Marishi el 25 de Ag. de 2020
Sorry i closed and restarted the MATLAB program it is working now ;)
Thanks alot!!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.

Productos

Versión

R2020a

Etiquetas

Preguntada:

el 25 de Ag. de 2020

Comentada:

el 25 de Ag. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by