str1='name'
str2='sirname'
what I want is to get
str3='name sirname'
I tried with:
str3=strcat(str1,str2)
str3=strcat(str1,' ',str2)
str3=strcat(str1,'\t',str2)
but with all these it doesn't work!
any hints?
thanks for help!!
silvia
This is expected behavior. Read the third paragraph in the Description
section of the reference page for STRCAT:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/strcat.html
a = 'hello ';
b = 'world';
[a b]
strcat(a, b)
strcat({a}, {b})
--
Steve Lord
sl...@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
Titus
"Silvia Appendino" <silvia.a...@polito.it> schrieb im Newsbeitrag
news:hjn040$j2p$1...@fred.mathworks.com...
STRCAT Concatenate strings.
T = STRCAT(S1,S2,S3,...) horizontally concatenates ...
... The trailing padding is ignored.
cat() will honor either embedded or trailing spaces or a blank string
placeholder
Probably simpler at least one way would be sprintf() letting the format
string handle it if the variables don't have trailing blanks. If they
do, those will be included as well.
>> sprintf('%s %s', 'name', 'surname')
ans =
name surname
--