Calculate the percentage in Matlab
<p>I want to calculate the percentage of accuracy. I have the code below. But it give unexpected output like this "The accuracy is 2.843137e+01x37".
While expected result is "The accuracy is 28.43%"</p>

<pre><code>y %Amount of correct data
j %Amount of all data
a = 'The accuracy is %dx%d.';
percent = '%.0f%%';
format short
acc = 100 * double(y/j);
sprintf (a,acc)
</code></pre>

<p>How to fix it?</p>

<p>Any help would be so much appreciated.
Thank you.</p>