rng('default') error message

4 次查看(过去 30 天)
Ilja
Ilja 2019-11-27
评论: Ilja 2019-12-3
Hi,
I'm using a Matlab program for which Matlab 2018a was required. I have the following:
MATLAB Version: 9.5.0.944444 (R2018b)
MATLAB License Number: XXXXXXXXXX
Operating System: Microsoft Windows 10 Enterprise Version 10.0 (Build 16299)
Java Version: Java 1.8.0_152-b16 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.5 (R2018b)
Brick, also called "fn toolbox" is a set of use... Version 1.1
Image Processing Toolbox Version 10.3 (R2018b)
Parallel Computing Toolbox Version 6.13 (R2018b)
Signal Processing Toolbox Version 8.1 (R2018b)
Statistics and Machine Learning Toolbox Version 11.4 (R2018b)
Wavelet Toolbox Version 5.1 (R2018b)
In this program the function rng.m is called upon several times but each time the following error message occurs:
Error using rand
State must be a double scalar or the output of RAND('twister').
Error in rng (line 18)
rand('twister',seed.rand);
Error in make_eMouseData (line 20)
rng('default');
Error in master_eMouse (line 26)
make_eMouseData(fpath, useGPU);
Simply running rng('default') spits out the following:
Error using rand
State must be a double scalar or the output of RAND('twister').
Error in rng (line 18)
rand('twister',seed.rand);
Thus, independent of whether I run the program or simpy the error causing function it leads to the same error message. I was wondering what I could do to fix this problem? Any advice would be greatly appreciated.
Thanks,
Ilja

采纳的回答

Walter Roberson
Walter Roberson 2019-11-28
Error in rng (line 18)
rand('twister',seed.rand);
Notice the line number of rng there: line 18. The real Mathworks rng.m has over 50 lines of comments at the beginning of it.
What is happening is that you have a different rng.m on your MATLAB path that is taking priority over the MATLAB rng.m
which -all rng
You should typically only see one result that is under toolbox/matlab/randfun/rng.m . I am fairly sure you will see two results instead and that the first one is not in a MATLAB installation directory. You will need to track that down and rename it or delete it.
  1 个评论
Ilja
Ilja 2019-12-3
Thanks, very much. Once I deleted the path to the wrong rng.m file it worked just fine.
Thanks again.
Ilja

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by