|
|
Re: sorting arrays in a cell array
Posted:
Nov 14, 2012 3:53 PM
|
|
"Steven_Lord" <slord@mathworks.com> wrote in message > > For such a small problem, if you preallocate firstElementsOfEachCell, using > the FOR loop to extract the first elements of each cell would probably be > more efficient (CELLFUN being a much bigger hammer than you need) and easier > to read.
Exactly right. As it happens, there are other benefits to an explicit FOR loop in this particular case, so that's what I'm doing. The CELLFUN approach is still a good one to keep in mind for future problems, though.
Bruce
|
|