Experiment, in the Command Window, with using the fprintf function for integers. Make a note of what happens for each. Use fprintf to print the integer 12345
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:3| Question number:3.7
All Answers
total answers (1)
Answers:
1/
>> fprintf('The number is %d\n', intnum)
The number is 12345
2/
>> fprintf('The number is %5d\n', intnum)
The number is 12345
3/
>> fprintf('The number is %5d\n', intnum)
The number is 12345
4/
>> fprintf('The number is %3d\n', intnum)
The number is 12345