generate unique random matrix using key
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 11 de Ag. de 2013
Editada: Azzi Abdelmalek
el 11 de Ag. de 2013
key=3 % for example
rng(key)
out=uint8(randi([0 255],2,4) % matrix 2x4
7 comentarios
Azzi Abdelmalek
el 11 de Ag. de 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
el 12 de Ag. de 2013
Editada: Walter Roberson
el 12 de Ag. de 2013
rng is only defined in later versions of MATLAB. see http://www.mathworks.com/help/matlab/ref/randstream.html
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!