How to check the numbers of characters of a string?
显示 更早的评论
e.g I have a string, abcde. And I need a checker to check whether the string has 5 characters before executing a command.
采纳的回答
更多回答(4 个)
Sean de Wolski
2012-10-31
Pedro's code with numel as the size check:
numel(str)==5
manoj saini
2012-10-31
0 个投票
>>a='string'; >>n=length(a) so n will return length of a string
类别
在 帮助中心 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!