How can I generate random numbers to plot my graph?
Mostrar comentarios más antiguos
x = randi([-50,50],1000,1);
y = randi([-50,50],1000,1);
So I got given a p-code file where I try out points and see if the artefacts are lying below or not.
The range are -50 to 50 on both x and y axis
I want to use random numbers to help me find out the info, but the code I used are only generating intergers. I want to generate random numbers in 4 decimal place covering the range -50 to 50.
1 comentario
John D'Errico
el 14 de Nov. de 2018
Did you read the help for rand? It gives an explicit example of how to generate random numbers (NOT integers) in a given range from a to b.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Random Number Generation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!