Re: Sort a list with hierarchy



It is sort of hard to tell what you want because the
newsreader deblanked your strings. I think this does it.


asm = { 'box';
' apple';
' pear';
' banana';
' apricot';
' kiwi';
' blueberry';
' pear';
' banana';
' apricot';
' kiwi';
' orange';
' orange';
' grape';
' plum';
' peach'}

srt = sort(byindent)
[idx,idx] = sort(cellfun(@length,strfind(srt,' ')))
byindent = srt(idx)
.



Relevant Pages

  • Sort a list with hierarchy
    ... The hierarchy is provided as a text file ... ' banana'; ... ' apricot'; ... ' kiwi'; ...
    (comp.soft-sys.matlab)
  • Sort a list with hierarchy
    ... The hierarchy is provided as a text file ... ' banana'; ... ' apricot'; ... ' kiwi'; ...
    (comp.soft-sys.matlab)
  • Re: Sort a list with hierarchy
    ... ' pear'; ... ' banana'; ... ' apricot'; ... ' kiwi'; ...
    (comp.soft-sys.matlab)
  • Kiwi and Banana in Lime Rum Syrup
    ... Kiwi and Banana in Lime Rum Syrup ... 1/4 teaspoon grated lime zest ...
    (rec.food.recipes)
  • Re: Hybrid pear and kiwi?
    ... local farmers market. ... The genus of the kiwi is not close to that of the pear and this would make natural hybridisation through cross pollination very difficult, although GE techniques can overcome some of those boundaries and there have been crosses between quite different plants before so it isn't altogether impossible. ...
    (rec.gardens.edible)