How to extract odd numbered elements.
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Generate a population of 10000 normally distributed elements with mean 2 and dispersion 3. Generate 1000 indexes at random from which only the odd ones are chosen to create a data sample.
Any idea or solution is helpful. My main issue is that I do not know how to extract only the odd numbered elements.
0 comentarios
Respuestas (1)
KSSV
el 22 de Mayo de 2023
A = 1:10 ;
% Pick only odd elements
idx = mod(A,2)~=0 ;
A(idx)
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!