I would like to concatenate strings. I tried using strcat:
x = 5;
m = strcat('is', num2str(x))
but this function removes trailing white-space characters from each string. Is there another MATLAB function to perform string concatenation which maintains trailing white-space?
You can use
horzcatinstead ofstrcat:Alternatively, if you’re going to be substituting numbers into strings, it might be better to use
sprintf: