当前位置:网站首页>Use of strjoin function in MATLAB
Use of strjoin function in MATLAB
2022-07-26 12:03:00 【jk_ one hundred and one】
Catalog
Use a blank list of join words
Join character vector cell arrays with delimiters
Join character vectors using multiple different delimiters
strjoin The function of the function is to join strings in an array .
grammar
str = strjoin(C)
str = strjoin(C,delimiter)explain
str = strjoin(C) By way of C The elements of are linked with spaces between consecutive elements , structure str.C It can be a character vector cell array or a string array .
str = strjoin(C,delimiter) By way of C Each element of the delimiter To construct str.
Example
Use a blank list of join words
Use a single white space to join the character vector cell array C Each character vector in .
C = {'one','two','three'};
str = strjoin(C)
str =
'one two three'Join character vector cell arrays with delimiters
Join the character vectors in the cell array into a character vector . Specify a comma followed by a space character as the separator .
C = {'Newton','Gauss','Euclid','Lagrange'}
C = 1x4 cell
{'Newton'} {'Gauss'} {'Euclid'} {'Lagrange'}
%%
str = strjoin(C,', ')
str =
'Newton, Gauss, Euclid, Lagrange'Join character vectors using multiple different delimiters
Specify several different delimiters in the character vector cell array .delimiter The cell array must contain more elements than C The number of elements contained is less than one .
C = {'one','two','three'};
str = strjoin(C,{' + ',' = '})
str =
'one + two = three'Input parameters
C - Input text
Input text , Designated as 1×n Character vector cell array or string array .
delimiter - Separator character
Separator character , Specify as character vector 、1×n Character vector cell array or 1×n Array of strings .
If delimiter Is a character vector , be strjoin By means of C Insert delimiter To form str.delimiter The input can include any of the following escape sequences :
\\
The backslash
\0
Null value
\a
alert
\b
Back space
\f
Page identifier
\n
A newline
\r
A carriage return
\t
Horizontal tabs
\v
Vertical tabs
If delimiter Is an array of character vector cells , Then it must contain more elements than C The number of elements contained is less than one . Each element in a cell array must be a character vector .strjoin Insert by interleaving delimiter and C To form str.delimiter All characters in are inserted as literal text , Escape sequence is not supported .
Tips
from R2016b Start , It is recommended to use join Function to join the elements of a string array .
边栏推荐
- 10 reduce common "tricks"
- Introduction to FPGA (II) - one out of two selector
- 零基础小白也能懂的 Redis 数据库,手把手教你易学易用!
- 面试官:如何处理高并发?
- 需不需要上线MES系统,你在纠结什么?
- Some practical, commonly used and increasingly efficient kubernetes aliases
- Recalling Sister Feng
- Transactional事务传播行为?
- [communication principle] Chapter 3 -- random process [i]
- JVM内存溢出和内存泄漏的区别
猜你喜欢
随机推荐
【附下载】一款强大的Web自动化漏洞扫描工具——Xray
Who is responsible for the problems of virtual idol endorsement products? And listen to the lawyer's analysis
Flink 在 讯飞 AI 营销业务的实时数据分析实践
[download attached] a powerful web automated vulnerability scanning tool - Xray
Redisson分布式锁流程详解(二)
Recalling Sister Feng
什么是Per-Title编码?
Marriage seeking story
Here blog: running a large language model in a production environment - overview of the reasoning framework
虚拟偶像代言产品出问题谁负责? 且听律师分析
11 "pocket" universities in China! Running on campus and leaving the school before accelerating
Metauniverse gamefi chain game system development NFT Technology
Flink cdc 是不是只支持 sql-client的方式提交SQL脚本啊
Transactional事务传播行为?
以太网驱动详解之RMII、SMII、GMII、RGMII接口
Li Kai: the interesting and cutting-edge audio and video industry has always attracted me
尤雨溪向初学者推荐Vite 【为什么使用Vite】
Wulin headlines - station building expert competition
元宇宙日报|元宇宙社交 App“派对岛”产品下架;广州南沙元宇宙产业集聚区揭牌;数字经济发展部际联席会议制度推出
Introduction to FPGA (II) - one out of two selector









