Displaying a value using fprintf with certain number of decimals.
1 view (last 30 days)
Shinichiro Shimata on 5 Mar 2021
I am trying to display the value of a using fprintf with only two decimals. Given a = 3.870081e+01;
Can you modify my code below to only display two decimals?
fprintf('The answer for a is %d m/s\n', a)