Escolar Documentos
Profissional Documentos
Cultura Documentos
strcat
Concatenar strings horizontalmente
Sintaxe
s = strcat(s1,...,sN)
Descrio
s = strcat(s1,...,sN)concatena horizontalmente s1,...,sN. Cada argumento de entrada pode ser exemplo
uma matriz de caracteres, uma matriz de clulas de vetores de caracteres ou uma matriz de caracteres.
Se alguma entrada uma matriz de string, o resultado uma matriz de string.
Se qualquer entrada uma matriz de clulas e nenhuma delas arrays de cordas, o resultado
uma matriz de clulas de vetores de caracteres.
Se todas as entradas so arrays de caracteres, o resultado uma matriz de caracteres.
Try it in MATLAB
s1 = 'Bom' ;
s2 = 'manh' ;
s = strcat (s1, s2)
s =
'Bom Dia'
Try it in MATLAB
s1 = { 'abcde' , 'fghi' };
s2 = { 'jkl' , 'mn' };
s = strcat (s1, s2)
https://www.mathworks.com/help/matlab/ref/strcat.html 1/3
29/10/2017 Concatenar cordas horizontalmente - MATLAB strcat
Try it in MATLAB
Text processing functions (such as strfind and regexp) accept string arrays as inputs, but other functions (for
example, addpath) do not.
Input text, specified as character arrays, cell arrays of character vectors, or string arrays. When combining string
or cell arrays with character arrays, the string or cell arrays must be either scalars or column vectors with the
same number of rows as the character arrays.
Tips
Character arrays also can be concatenated using left and right square brackets.
s1 = 'Good ';
https://www.mathworks.com/help/matlab/ref/strcat.html 2/3
29/10/2017 Concatenar cordas horizontalmente - MATLAB strcat
s2 = 'Morning';
s = [s1 s2]
s =
Good Morning
See Also
cat | cellstr | horzcat | join | strjoin | vertcat
https://www.mathworks.com/help/matlab/ref/strcat.html 3/3