Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
reorder the data array for the least distance
    4 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
I have a data array
a =
       1     1     1     1     1     1     1     1     1     1     1     1     1     1     1     1
       1     1     1     1     1     1     1     1     1     1     1     1     1     1     1     1
       1     1     0     0     0     0     0     1     1     0     0     0     0     0     1     1
       1     1     0     0     0     0     0     1     1     0     0     0     0     0     1     1
       1     1     0     0     0     0     0     1     1     0     0     0     0     0     1     1
       1     1     0     0     0     0     0     1     1     0     0     0     0     0     1     1
       1     1     0     0     0     0     0     1     1     0     0     0     0     0     1     1
       1     1     1     1     1     1     1     1     1     1     1     1     1     1     1     1
       1     1     1     1     1     1     1     1     1     1     1     1     1     1     1     1
Which I converted into a two column data array by picking up all the ones using
CC = bwconncomp(a) 
data = regionprops(CC, 'PixelList')
The new data is organized by rows, e.g.,
       3     1
       3     2
       3     8
       3     9
       4     1
       4     2
       4     8
       4     9
  .....
I would like to reorganize it like
       3     1
       3     2
       4     1
       4     2
  .....
       3     8
       3     9
       4     8
       4     9
  .....
so the connected points are next to each other. Any idea on how to achieve this?
Thanks!
0 comentarios
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

