matlab 组合字符串 strcat 和strvact

1 matlab数组中变量以列的形式存在

2.组合字符串 strcat 和strvact的区别在于前者是两个字符串的组合,而后者是组合成一个字符矩阵,后者将短字符扩充成长字符相等的长度。

a = 'hello';
b = 'world';
c = strcat(a,b);
d = strvcat(a,b,c);
`
%打印结果
>> c

c =

    'helloworld'

>> d

d =

  3×10 char 数组

    'hello     '
    'world     '
    'helloworld'
``
%whos查询

whos
  Name      Size            Bytes  Class     Attributes

  a         1x5                10  char                        
  b         1x5                10  char                
  c         1x10               20  char                
  d         3x10               60  char                




猜你喜欢

转载自blog.csdn.net/guangjie2333/article/details/88376049