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 件のコメント

Rik
Rik 2020 年 8 月 25 日
What does which('randi','-all') return?
Aayush Marishi
Aayush Marishi 2020 年 8 月 25 日
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

サインインしてコメントする。

 採用された回答

Rik
Rik 2020 年 8 月 25 日
編集済み: Rik 2020 年 8 月 25 日

1 投票

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 件のコメント

Aayush Marishi
Aayush Marishi 2020 年 8 月 25 日
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 2020 年 8 月 25 日
Sorry i closed and restarted the MATLAB program it is working now ;)
Thanks alot!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品

リリース

R2020a

タグ

質問済み:

2020 年 8 月 25 日

コメント済み:

2020 年 8 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by