How i can insert a random integer between two numbers?
    3 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
I have a variable and i want it to take a randome integer between numbers 2 and 101
0 comentarios
Respuestas (2)
  Thomas Koelen
      
      
 el 22 de Abr. de 2015
        
      Editada: Thomas Koelen
      
      
 el 22 de Abr. de 2015
  
      a=uint16(2+rand*99)
0 comentarios
  Star Strider
      
      
 el 22 de Abr. de 2015
        The randi function is perfect for this:
rv = randi([2 101]);
0 comentarios
Ver también
Categorías
				Más información sobre Random Number Generation 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!


