count number of elements in a cell
Show older comments
say I have x={'zyryan';'zythem';'zythia';'zythum';'zyzomys'}
how would I count the number of elements in x. There are 5 words in x so I would like the output to be 1
1 Comment
Stephen23
on 11 Nov 2015
Your example vector x has five elements (five cells), so where do you get the value 1 from?
Accepted Answer
More Answers (1)
Stephen23
on 11 Nov 2015
>> x={'zyryan';'zythem';'zythia';'zythum';'zyzomys'};
>> numel(x)
ans = 5
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!