TASK: Print multiplication tables.
COMMENT: Multiplication tables show us in row I and column J the product I*J. We want to write a script that inputs two integers P and Q from the user, where P is less than Q, and prints out the multiplication tables for numbers from P to Q.
If P = 2 and Q = 5, we would print out:
4 6 8 10 6 9 12 15 8 12 16 20 10 15 20 25which represent rows 2 through 5, and columns 2 through 5, of a multiplication table.
INSTRUCTIONS:
Use MATLAB's input() statement to request values for p and q. Use a for loop, with counter "i" running from p to q, to handle each row. Inside of that loop, use another for loop, with counter "j", also running from p to q, to deal with each column. Print the value of i * j. Use an fprintf() statement that does NOT include a "new line" symbol, like this: fprintf ( ' %d', i * j ); end the inner "j" loop. Terminate this row with a "new line". fprintf ( '\n' ); end the outer "i" loop.
SUBMIT: Your work should be stored in a script file called "hw014.m". Your script file should begin with at least three comment lines:
% hw014.m % YOUR NAME % This script (describe what it does) % Add any comments here that you care to make.If this problem is part of an assignment, then submit it to Canvas.