On 7/10/2013 12:47 PM, Steven_Lord wrote:
> "Bruce Bowler" <bbowler@bigelow.org> wrote in message
> news:b45k05FqaeoU1@mid.individual.net...
>> ... I have a cell array, let's call it c. ...
...
>> how can I create d, ... a logical array that
[is true for numeric cells in c?]
>
> c = {1,2,3,'four',5,6,7,8,9};
> d = cellfun(@isnumeric, c)
> onlyNumericElementsOfC = c(d) % Anticipating the next step
> onlyNonnumericElementsOfC = c(~d)
>
> *snip*
>
OK, Steven, no fair!!! Just when I had posted a practice successful
cellfun() you beat posting time by ~7 min...
:)
--
> "Bruce Bowler" <bbowler@bigelow.org> wrote in message
> news:b45k05FqaeoU1@mid.individual.net...
>> ... I have a cell array, let's call it c. ...
...
>> how can I create d, ... a logical array that
[is true for numeric cells in c?]
>
> c = {1,2,3,'four',5,6,7,8,9};
> d = cellfun(@isnumeric, c)
> onlyNumericElementsOfC = c(d) % Anticipating the next step
> onlyNonnumericElementsOfC = c(~d)
>
> *snip*
>
OK, Steven, no fair!!! Just when I had posted a practice successful
cellfun() you beat posting time by ~7 min...
:)
--