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