stringArrayLength(S​)

版本 2.0.0.0 (990 字节) 作者: Sugato
This function returns the length of string(s) in a single string or a cellarray or a matrix.
21.0 次下载
更新时间 2017/8/14

查看许可证

Function Description
This function returns the length of string(s) in a single string or a
cellarray or a matrix.
AUTHOR: Sugato Ray | Created on: 12-AUG-2017 | ray.sugato[at]gmail.com

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PLEASE ACKNOWLEDGE THE AUTHOR IF YOU USE THIS CODE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

INPUT:
S = a string array or a string matrix

OUTPUT:
L = a numeric array or a matrix, with the same size and shape as S.

EXAMPLE:
L = stringArrayLength(S);
Try This:
S = {'abc','2D','1','gavlvvglbv','guDVWF FIUWWFH ihf poj','gtwe66etr2rrhndm\['}
L = stringArrayLength(S)

引用格式

Sugato (2025). stringArrayLength(S) (https://www.mathworks.com/matlabcentral/fileexchange/64096-stringarraylength-s), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2016a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
2.0.0.0

Updated the code for a better and faster alternative suggested by Jan Simmon.

1.0.0.0

Updated description.