strcatConcatenating character arrays
strcat(s1, s2, ..., sn)s1, s2, ..., sn is either a row vector or a matrix. They must be arrays of numerical values or characters.s1, s2, ..., sn are matrices, they must have same heights. If any one of the inputs is a row vector, it will be expanded vertically to matches the heights of the matrix inputs.s1, s2, ..., sn horizontally.s1, s2, ..., sn, whereas SIMO does not.a = 'I love 🚙 '
b = 'and you!'
strcat(a,b)
ans =
I love 🚙 and you!
a and b are expanded vertically to match the height of c.a = 'I love ';
b = 'and you!';
c = ['🚙 ';'🚚 '];
strcat(a,c,b)
ans =
I love 🚙 and you!
I love 🚚 and you!
strcat converts matrices of double values to character arrays before performing catenation.% Array sizes
m1=3; n1=5;
m2=3; n2=6;
% Double arrays
dbl1=randi(100,m1,n1)
dbl2=randi(100,m2,n2)
% The double arrays are converted to characters
% and then catenated.
cat=strcat(dbl1, dbl2)
dbl1 =
52.000 40.000 57.000 33.000 29.000
21.000 66.000 6.0000 67.000 38.000
26.000 11.000 92.000 43.000 39.000
dbl2 =
45.000 83.000 71.000 89.000 9.0000 99.000
15.000 74.000 99.000 87.000 98.000 2.0000
7.0000 32.000 75.000 59.000 18.000 61.000
cat =
4(9!U-SGYUc
UBUC&UJcWbU
UU\+'U K;U=