x is a double-precision floating point number. It will be displayed as a decimal by default. You can control how the double is represented (like scientific notation), but there is no built-in ability to display a double in terms of pi multiples. You're specifically trying to represent x in terms of pi/n for the appropriate n value.
Use the '\pi' character to display the symbol for pi. Calculate the value n = pi/x to build the expression "x = pi/n" in the title.
str = sprintf('Output x=%s/%d','\pi',pi/x);