Borrar filtros
Borrar filtros

How to generate pair of numbers from sequence ?

2 visualizaciones (últimos 30 días)
kitty varghese
kitty varghese el 28 de Nov. de 2018
Editada: kitty varghese el 28 de Nov. de 2018
I have a sequence of 100 numbers and I want to generate a pair of these numbers.
for example : 1 2
3 4
5 6
.
.
.
99 100
a=randperm(100)
k=a(1:2:end)
k1=a(2:2:end)

Respuesta aceptada

Geoff Hayes
Geoff Hayes el 28 de Nov. de 2018
kitty - you could try using reshape to create a 50x2 matrix of pairs
a = reshape(randperm(100), [50 2])

Más respuestas (0)

Categorías

Más información sobre Interpolation 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