当前位置:网站首页>MATLAB中strjoin函数使用
MATLAB中strjoin函数使用
2022-07-26 11:50:00 【jk_101】
目录
strjoin函数的功能是联接数组中的字符串。
语法
str = strjoin(C)
str = strjoin(C,delimiter)说明
str = strjoin(C) 通过将 C 的元素与连续元素之间的空格链接起来,构造 str。C 可以是字符向量元胞数组或字符串数组。
str = strjoin(C,delimiter) 通过将 C 的每个元素与 delimiter 中的元素联接来构造 str。
示例
使用空白联接字词列表
使用单个空白联接字符向量元胞数组 C 中的各个字符向量。
C = {'one','two','three'};
str = strjoin(C)
str =
'one two three'使用分隔符联接字符向量元胞数组
将元胞数组中的字符向量联接为一个字符向量。指定逗号后跟空格字符作为分隔符。
C = {'Newton','Gauss','Euclid','Lagrange'}
C = 1x4 cell
{'Newton'} {'Gauss'} {'Euclid'} {'Lagrange'}
%%
str = strjoin(C,', ')
str =
'Newton, Gauss, Euclid, Lagrange'使用多个不同的分隔符联接字符向量
在字符向量元胞数组中指定多个不同的分隔符。delimiter 元胞数组包含的元素数必须比 C 包含的元素数少一个。
C = {'one','two','three'};
str = strjoin(C,{' + ',' = '})
str =
'one + two = three'输入参数
C - 输入文本
输入文本,指定为 1×n 字符向量元胞数组或字符串数组。
delimiter - 分隔字符
分隔字符,指定为字符向量、1×n 字符向量元胞数组或 1×n 字符串数组。
如果 delimiter 是字符向量,则 strjoin 通过在 C 的每个元素之间插入 delimiter 来形成 str。delimiter 输入可以包括下列任何转义序列:
\\
反斜杠
\0
空值
\a
警报
\b
退格符
\f
换页符
\n
换行符
\r
回车符
\t
水平制表符
\v
垂直制表符
如果 delimiter 是字符向量元胞数组,则它包含的元素数必须比 C 包含的元素数少一个。元胞数组中的每个元素必须是字符向量。strjoin 通过交错插入 delimiter 和 C 的元素来形成 str。delimiter 中的所有字符作为字面文本插入,不支持转义序列。
提示
从 R2016b 开始,建议使用 join 函数联接字符串数组的元素。
边栏推荐
- 向日葵资深产品总监技术分享:如何在AD域环境下应用
- Data center construction (II): brief introduction to data center
- Yuancosmos daily | yuancosmos social app "Party Island" product off the shelves; Guangzhou Nansha yuanuniverse industrial agglomeration zone was unveiled; The inter ministerial joint conference system
- 。。。。。。
- Redis实现Single单点登入详解
- Talking about web vitals
- How did the $50000 annual salary run out
- Ga-rpn: recommended area network for guiding anchors
- DS-24C/DC220V时间继电器
- 百问百答第48期:极客有约——可观测体系的建设路径
猜你喜欢

最新心形拼图小程序源码+带流量主

Is it easy to find a job after programmer training?

Practice of microservice in solving Library Download business problems

V00 - 年纪大了,想做啥就做啥吧

基于 Flink CDC 实现海量数据的实时同步和转换

系统调用捕获和分析完结篇制作系统调用日志收集系统
2022就业季!Adobe助力创意产业工作者,突破技能桎梏,回归能力本源
![[early knowledge of activities] list of recent activities of livevideostack](/img/a5/06c13865b7adbd99d43c1a52f3fc4d.png)
[early knowledge of activities] list of recent activities of livevideostack

零基础小白也能懂的 Redis 数据库,手把手教你易学易用!

初试YOLOv7
随机推荐
[communication principle] Chapter 3 -- random process [i]
An online duplicate of a hidden bug
【安徽大学】考研初试复试资料分享
Pytest interface automation test framework | rerun failed cases
Fineos announced the open registration of grouptech connect activities in 2022
Practice of microservice in solving Library Download business problems
pytest接口自动化测试框架 | 通过标记表达式执行用例
系统调用捕获和分—Ring3层LD_PRELOAD机制进行库函数劫持
一些实用、常用、效率越来越高的 Kubernetes 别名
Hashtable
。。。。。。
pytest接口自动化测试框架 | pytest常用插件
System call capture and analysis conclusion making system call log collection system
剑指 Offer 24. 反转链表
Koin
What is per title encoding?
3.1 创建菜单与游戏页面——上
Marriage seeking story
System call capture and analysis - ring layer kprobe hijacks system calls
There are various signs that apple is expected to support AV1