generate unique random matrix using key

1 Ansicht (letzte 30 Tage)
vardhit
vardhit am 11 Aug. 2013
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 Kommentare
Jan
Jan am 12 Aug. 2013
How large is the key and the matrix?
vardhit
vardhit am 12 Aug. 2013
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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 11 Aug. 2013
Bearbeitet: Azzi Abdelmalek am 11 Aug. 2013
key=3 % for example
rng(key)
out=uint8(randi([0 255],2,4) % matrix 2x4
  7 Kommentare
Azzi Abdelmalek
Azzi Abdelmalek am 11 Aug. 2013
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 am 12 Aug. 2013
Bearbeitet: Walter Roberson am 12 Aug. 2013
rng is only defined in later versions of MATLAB. see http://www.mathworks.com/help/matlab/ref/randstream.html

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by