Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: sorting arrays in a cell array
Replies: 23   Last Post: Nov 15, 2012 11:16 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bruce Elliott

Posts: 109
Registered: 11/9/07
Re: sorting arrays in a cell array
Posted: Nov 13, 2012 11:01 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

dpb <none@non.net> wrote in message <k7tqec$9mm$1@speranza.aioe.org>...
> All that comes to mind would be to use multi--level indexing as above
> but to an temporary variable then sort that saving the (optional) index
> return value then use it to rearrange the cells...
> Actually my release doesn't have the multi-level indexing implemented so
> I can't test it but it would be what you have above augmented (methinks,
> air code)--
> [~,ix]=sort([myCellArray{:}(1)]);
> newCell=myCellArray(ix);
> --

Well, that's just it - I'd like to do that, but that sort() statement above is illegal.

Actually, it's the syntax myCellArray{:}(1) that's illegal. You can do myCellArray{1}(1), but the {:} is not allowed in combination with the (1).

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.