The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]
Steven Lord

Posts: 18,038
Registered: 12/7/04
Re: sorting arrays in a cell array
Posted: Nov 14, 2012 9:59 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"dpb" <> wrote in message news:k7trk4$cmj$
> On 11/13/2012 10:01 AM, Bruce Elliott wrote:
> ...

>> 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).

> Well that pretty much sucks--looks like time for enhancement request.
> That's a pretty major weakness in multi-level indexing if you can't
> generalize it.

One reason why that's not allowed: there's no guarantee that any particular
cell of myCellArray contains a 1st element.

myCellArray = {1:10, [], 11, 12}

If I were just displaying:

>> myCellArray{:}(1)

what should be displayed? Should it error right away (only displaying once
the command is fully executed) or should it display the first element of the
comma-separated list then throw the error?

Steve Lord
To contact Technical Support use the Contact Us link on

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.