当前位置:网站首页>MATLAB中iscellstr函数的使用
MATLAB中iscellstr函数的使用
2022-06-23 15:13:00 【jk_101】
目录
iscellstr函数的功能是确定输入是否为字符向量元胞数组。
语法
tf = iscellstr(A)说明
如果 A 为字符向量元胞数组(或空元胞数组),则 tf = iscellstr(A) 返回逻辑值 1 (true),否则返回逻辑值 0 (false)。字符向量元胞数组是一种每个元胞都包含一个字符向量的元胞数组。
示例
确定数组是否为字符向量元胞数组
创建一些不同的数组,然后确定它们是否为字符向量元胞数组。测试字符向量元胞数组。
C1 = {'Smith','Chung','Morales'; ...
'Sanchez','Peterson','Adams'}
C1 = 2x3 cell
{'Smith' } {'Chung' } {'Morales'}
{'Sanchez'} {'Peterson'} {'Adams' }
tf = iscellstr(C1)
tf = logical
1C1 的每个元胞都包含一个字符向量,因此 iscellstr 返回 1。将 C1 转换为字符串数组并进行测试。
str = string(C1)
str = 2x3 string
"Smith" "Chung" "Morales"
"Sanchez" "Peterson" "Adams"
tf = iscellstr(str)
tf = logical
0str 是字符串数组,而非元胞数组,因此 iscellstr 返回 0。测试包含不同数据类型的元素的元胞数组。
X = rand(1,3);
C2 = {'red','blue',X}
C2=1×3 cell array
{'red'} {'blue'} {[0.8147 0.9058 ... ]}
tf = iscellstr(C2)
tf = logical
0
C2 具有一个不包含字符向量的元胞,因此 iscellstr 返回 0。
A- 输入数组
标量 | 向量 | 矩阵 | 多维数组
输入数组,指定为标量、向量、矩阵或多维数组。A可以是任何数据类型。
边栏推荐
- Volatile~ variables are not visible under multithreading
- JS里的数组
- 139. 单词拆分
- Why can a high pass filter become a differentiator?
- The "shoulder" of sales and service in the heavy truck industry, Linyi Guangshun deep ploughing product life cycle service
- SFOD:无源域适配升级优化,让检测模型更容易适应新数据(附论文下载)
- ABP框架之——数据访问基础架构(下)
- 30. concatenate substrings of all words
- [opencv450] salt and pepper noise demo
- 嵌入式软件架构设计-程序分层
猜你喜欢

stylegan1: a style-based henerator architecture for gemerative adversarial networks
Sorting out and summarizing the handling schemes for the three major exceptions of redis cache

JS garbage collection

golang 重要知识:context 详解

Jsr303 data verification

Analysis of graphical level-1 programming problem of Electronic Society: cat and mouse

Important knowledge of golang: atomic atomic operation

【无标题】激光焊接在医疗中的应用

他山之石 | 微信搜一搜中的智能问答技术

stylegan3:alias-free generative adversarial networks
随机推荐
Explore the "store" on the cloud. The cloud store is newly upgraded!
Six programming insights in these five years!
VIM backup history command
解决:在验证阶段,第一个batch不会报错,第二个batch报cuda超出的错误
139. 單詞拆分
Nfnet: extension of NF RESNET without BN's 4096 super batch size training | 21 year paper
Thymeleaf——学习笔记
139. word splitting
C. Set or Decrease-Educational Codeforces Round 120 (Rated for Div. 2)
glibc nptl库pthread_mutex_lock和pthread_mutex_unlock浅析
地平线开发板 调试
JS traversal array (using the foreach () method)
Une compréhension simple du tri rapide
Unshift() and shift() of JS
Introduction to the push function in JS
Sorting out and summarizing the handling schemes for the three major exceptions of redis cache
golang 重要知识:waitgroup 解析
Usestate vs useref and usereducer: similarities, differences and use cases
JS中的pop()元素
Converging ecology, enabling safe operation, Huawei cloud security, cloud brain intelligent service security