[SOLVED] Assignment for MatLab 243
Im trying to study for my Computer Science course and I need some help to understand this question.
- 1. Write an input statement that will prompt the user for a real number, and store it in a variable.Then, use the fprintf function to print the value of this variable using 2 decimal places.
- 2. When would you use disp instead of fprintf?When would you use fprintf instead of disp?
- 3. Trace the following code and determine what will be printed after each line is executed.
num = 12.3;
fprintf ( ‘ Hmm how many ‘)
fprintf( ‘ lines n nwill print? n’ )
fprintf( ‘ %6.2f n’, num)
- 4. When would it be important to use legend in a plot?
5. Write a script that would create a 3×5 matrix of random integers and write this new matrix to a file called Assignment3_Question5.dat.