Experiment, in the Command Window, with using the fprintf function for real numbers. Make a note of what happens for each. Use fprintf to print the real number 12345.6789
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:3| Question number:3.6
All Answers
total answers (1)
Answers:
1/
>> fprintf('The number is %f\n', realnum)
The number is 12345.678900
2/
>> fprintf('The number is %10.4f\n', realnum)
The number is 12345.6789
3/
>> fprintf('The number is %10.4f\n', realnum)
The number is 12345.6789
4/
>> fprintf('The number is %6.4f\n', realnum)
The number is 12345.6789
5/
>> fprintf('The number is %2.4f\n', realnum)
The number is 12345.6789