How to count total number of characters
5 views (last 30 days)
Show older comments
I have a single verticle matrix, 32x1, and it has random values that range from 9870 to -889. I need to count how many total number of characters are in this array. It should be easy, but I can't figure out the call term. I've tried length, isspace, sum, but all they keep giving me is 32. help
4 Comments
Azzi Abdelmalek
on 5 Oct 2013
Edited: Azzi Abdelmalek
on 5 Oct 2013
But you said that you have 32x1 array, which means 32 numbers. Please post a sample of your data
Accepted Answer
Azzi Abdelmalek
on 5 Oct 2013
a=[3 4 90 76 -877]
b=num2str(a)
out=numel(regexprep(b,'[\s-]+',''))
0 Comments
More Answers (0)
See Also
Categories
Find more on Graphics Object Programming 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!