Borrar filtros
Borrar filtros

how to create a vector of 5 random integers each in rang of -10 and 10.

2 visualizaciones (últimos 30 días)
how to create a vector of 5 random integers each in rang of -10 and 10. Perform each of the following using only vectorized code:
Subtract 3 from each element,
Count how many are positive,
Get the absolute value of each element,
Find the maximum.

Respuestas (2)

Walter Roberson
Walter Roberson el 7 de Nov. de 2012
Read the documentation for randi()

Amin Bashi
Amin Bashi el 7 de Nov. de 2012

Categorías

Más información sobre Random Number Generation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by