Functions istext iscelltext

版本 1.0.0 (2.7 KB) 作者: Bill Whiten
Test for char or string variables; Test for cell array of char or string variables.
20.0 次下载
更新时间 2018/9/26

查看许可证

Most function now allow either char of string variables.
However missing are functions to test for either string or char,
and to test for a cell array containing only string or char values.

Two functions v=istext(x) and v=iscelltext(x) are included or
can be used inline as:

istext=@(x)isstring(x)|ischar(x);
iscelltext=@(x)all(cellfun(@(y)isstring(y)|ischar(y),x,'UniformOutput',1));

引用格式

Bill Whiten (2024). Functions istext iscelltext (https://www.mathworks.com/matlabcentral/fileexchange/68918-functions-istext-iscelltext), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2018b
与 R2016b 及更高版本兼容
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Test Scripts 的更多信息
标签 添加标签
致谢

启发作品: Optional function arguments

Community Treasure Hunt

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

Start Hunting!

istext_iscelltext

版本 已发布 发行说明
1.0.0