MATLAB: Help about fprintf ( ‘x = % f / n’, x)

fprintf

I dont understand meaning of (x = %f/n',x), Whats point/meaning in x = %f in help i can only find that /n represent new line, but whats x=%f for?

Best Answer

Try setting
x=pi;
and then the above line at the command line and see...
Also, under the doc for formatting strings under the formatspec link is the following section towards the end --
"The string can also include combinations of the following: ..."
Read that portion carefully.