MATLAB: How create string like this: word+number+word with number=num2str(x)

matMATLABstring

Hi everyone,
how could I write a string like the following word+number+word with number=num2str(x). For example:
x=2; x_str=num2str(x); y='I have' x_str 'dogs'
Thank you for your help.

Best Answer

x=2;
y= ['I have' num2str(x) 'dogs'];