Это потому, что strcat
удаляет пробелы. По doc strcat
:
For character array inputs, strcat removes trailing ASCII white-space characters: space, tab, vertical tab, newline, carriage return, and form-feed.
Решения:
1) Вы можете попробовать sprintf('Transfer is %d%% complete', percentage);
2) Используйте ['Transfer is ', num2str(percentage), '% complete']
вместо strcat
для объединения строк.