Thursday, March 22, 2012

MATLAB concatinate strings trailing space

Concatinating strings is easy with result = strcat(s1,s2,...sN) except that strcat trims trailing space from each string, ruining attempts at formatting. The solution is to think in terms of MATLAB's array addition. In this case, you simply declare result = [s1 s2 ... SN].

http://www.mathworks.com/help/techdoc/ref/strcat.html