Finding the product within an interval
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Noah Kebschull
el 19 de Nov. de 2017
Comentada: Noah Kebschull
el 19 de Nov. de 2017
I have 250 element row vector of random numbers between intervals (-4.5, 5.5). Once I create that vector, how would I find the product of all elements between intervals (2.3, 2.6)?
0 comentarios
Respuesta aceptada
Roger Stafford
el 19 de Nov. de 2017
Editada: Roger Stafford
el 19 de Nov. de 2017
If v is your vector of random numbers, do this:
p = prod(v(v>=2.3 & v<=2.6)); % The desired product
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB 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!