MATLAB 帮助中心
本页翻译不是最新的。点击此处可查看最新英文版本。
确定输入是否为字符串数组
tf = isstring(A)
如果 A 是字符串数组,tf = isstring(A) 将返回 1 (true)。否则,将返回 0 (false)。
A
1
true
0
false
示例
全部折叠
创建一些不同的数组,然后确定它们是否为字符串数组。
测试一个字符向量。
chr = 'Mary Jones'
tf = isstring(chr)
tf = logical 0
字符向量不是字符串,所以 isstring 返回 0。
isstring
测试字符串数组。
str = ["Smith","Chung","Morales"; ... "Sanchez","Peterson","Adams"]
str = 2×3 string "Smith" "Chung" "Morales" "Sanchez" "Peterson" "Adams"
tf = isstring(str)
tf = logical 1
str 是字符串数组,所以 isstring 返回 1。
str
输入数组,指定为标量、向量、矩阵或多维数组。A 可以是任何数据类型。
全部展开
backgroundPool
ThreadPool
此函数完全支持基于线程的环境。有关详细信息,请参阅在基于线程的环境中运行 MATLAB 函数。
此函数完全支持分布式数组。有关详细信息,请参阅使用分布式数组运行 MATLAB 函数 (Parallel Computing Toolbox)。
在 R2016b 中推出
cellstr | char | iscategorical | iscell | isstrprop | isstruct | isa | iscellstr | istable | ischar | string | isStringScalar
cellstr
char
iscategorical
iscell
isstrprop
isstruct
isa
iscellstr
istable
ischar
string
isStringScalar
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处