How to check the numbers of characters of a string?
Show older comments
e.g I have a string, abcde. And I need a checker to check whether the string has 5 characters before executing a command.
Accepted Answer
More Answers (4)
Sean de Wolski
on 31 Oct 2012
Pedro's code with numel as the size check:
numel(str)==5
manoj saini
on 31 Oct 2012
0 votes
>>a='string'; >>n=length(a) so n will return length of a string
Ze Kai Ng
on 31 Oct 2012
0 votes
Ze Kai Ng
on 31 Oct 2012
0 votes
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!