generate unique random matrix using key

조회 수: 1 (최근 30일)
vardhit
vardhit 2013년 8월 11일
i want to get a key(integers/character/string) from the user and generate a random matrix using that key and particular to that key only. meaning if i again use that key for generating a matrix i would get similar matrix.matrix should be having unit8 values less than 256.
  댓글 수: 2
Jan
Jan 2013년 8월 12일
How large is the key and the matrix?
vardhit
vardhit 2013년 8월 12일
matrix can be as large as an image matrix can be.. i really dont have any idea about key..but if u ask me about the sample space of key.i want it to be from integer 1-100.or even a string.

댓글을 달려면 로그인하십시오.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 11일
편집: Azzi Abdelmalek 2013년 8월 11일
key=3 % for example
rng(key)
out=uint8(randi([0 255],2,4) % matrix 2x4
  댓글 수: 7
Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 11일
I don't know if it's due to the version of your Matlab, or there is another problem. Maybe you should contact Mathworks technical support
Walter Roberson
Walter Roberson 2013년 8월 12일
편집: Walter Roberson 2013년 8월 12일
rng is only defined in later versions of MATLAB. see http://www.mathworks.com/help/matlab/ref/randstream.html

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by