# MATLAB: Sprintf/fprintf help

fprintfhelpMATLABsprintf

n=10 if i want the output to say "You have done this activity 10 times" how would i write it? I know for fprintf('You have done this activity \n'), the n would go in there, but is there a write is so that i could include words after \n? And should i use sprintf or fprintf?

N = 10;str = sprintf('You have done this activity %d times.\n', N);
fprintf(fido, 'You have done this activity %d times.\n', N)