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 5:21 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"dpb" <> wrote in message news:k813je$4hr$
> On 11/14/2012 3:12 PM, Bruce Elliott wrote:
> ...

>> I'm still not sure exactly what you mean by a "multi-level index", which
>> you stated earlier that you don't have in your version of Matlab. Do you
>> mean the ability to write something like,
>> x = myCellArray{3,4}(5,6); ?
>> That's just a basic bit cell array functionality, which has been around
>> a pretty long time, I believe. (I can't remember when cell arrays were
>> first introduced, which ought to mean that it was quite a while ago,
>> although lately it doesn't mean that quite the way it used to ...)

> <>
> It's _now_ "basic" cell array functionality but it wasn't for at least a
> couple of releases after cell arrays were first introduced.
> Cell arrays existed at least as far back as R11; I'm currently at R12
> which is roughly '99/'00 time frame.

Cell arrays were introduced in MATLAB 5.0 (R10). For reference some of the
other features introduced in that release, according to the WHATSNEW
function, were:

struct arrays
multidimensional arrays
the original MATLAB object system
ODE solvers

> But the second level of indexing ('multi-level') wasn't introduced until
> sometime after that. If I do

> >> c(2,3)={rand(4)}
> c =
> [] [] []
> [] [] [4x4 double]

> >> c(2,3)
> ans =
> [4x4 double]

> >> c(2,3){1,1}
> ??? Error: () Indexing must appear last in an index expression.

That still doesn't work. Use c{2, 3}(1, 1) instead. I tried it and it works
in release R10.


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.