You can use:
A = 5 printf("There are %d horses\n", A)
output:
There are 5 horses
or even
disp(["There are ", num2str(A), " horses"])
or even
disp(strcat("There are ", num2str(A), " horses"))
but you will need to add something because octave / matlab does not skip the space at the end of the line, so the output is:
ans = There are5 horses
source share