When I use sprintf, the results show like this :
sprintf('number=%d %d %d',a,b,c)
sprintf('or %d',h)
ans =
number= 5 4 2
ans =
or 2
How can I display the results without ans =
obstructing them ?
You can use fprintf
instead of sprintf
. Remember to put a newline \n
at the end of your strings.