how to divide into groups equally

16 visualizaciones (últimos 30 días)
Pat
Pat el 19 de Sept. de 2011
a=[1 9 2 4 3 5 4 6 5 1 6 9 7 0 8 3 9 1 0 2 3 6 3 4 3 7 8 1 8 7 9 2 0 3 4 6 5 7 8 9 ] i want to divide this data into 5 groups so taht the values in the column 1 and 2 should not change....... have to do this for large data also,can anyone help the output must be
group1 group5 1 9 0 3 2 4 4 6 3 5 5 7 4 6 8 9
can anyone tell how to process plz

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 19 de Sept. de 2011
n = 5;
k = size(a,1)/n;
groups5 = reshape(permute(reshape(a,k,[],2),[1 3 2]),k,[]);
  1 comentario
Pat
Pat el 19 de Sept. de 2011
THANK U SIR,CAN U TELL HOW TO DO IT RANDOMLY

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Engines & Motors 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