count number of elements in a cell
80 次查看(过去 30 天)
显示 更早的评论
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 个评论
Stephen23
2015-11-11
Your example vector x has five elements (five cells), so where do you get the value 1 from?
采纳的回答
Star Strider
2015-11-11
I have no idea what result you want, but the size function will work:
x={'zyryan';'zythem';'zythia';'zythum';'zyzomys'};
sz_x = size(x)
sz_x =
5 1
更多回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!