Things under legendu
To display special characters (e.g.
\n,\tand so on), you have to usesprintfto format it first.fprintfdoes the job of formatting and printing together.Unlike R, numbers in MATLAB will not be silently converted to strings when needed. You must use the function
num2strto convert numbers to strings manually.