MATLAB: Use fprintf to create a multiplication table. fprintfhomework Create a multiplication table from 1 to 13 for the number 6. Your table should look like this. 1 times 6 is 6 2 times 6 is 12 3 times 6 is 18 . . . Best Answer clcStart=6;Stop=6;for u=Start:Stop; for v=1:13; fprintf('%d times %d is %d\n',u,v,u*v) end fprintf('\n')endThe code works for more than what is requested, for example create several multiplication tablesclcStart=1;Stop=10;for u=Start:Stop; for v=1:10; fprintf('%d times %d is %d\n',u,v,u*v) end fprintf('\n')endSimple version for just what is requested clc for v=1:13 fprintf('%d times %d is %d\n',6,v,6*v) end Related SolutionsMATLAB: How to Create a Multiplication Table in MATLAB Using while Loops % Create 7 tablen = 1:13;m = n.*7;table = [n;m] ;fprintf('7 x %d = %d \n',table)7 x 1 = 7 7 x 2 = 14 7 x 3 = 21 7 x 4 = 28 7 x 5 = 35 7 x 6 = 42 7 x 7 = 49 7 x 8 = 56 7 x 9 = 63 7 x 10 = 70 7 x 11 = 77 7 x 12 = 84 7 x 13 = 91 MATLAB: How can i create a table fprintf('%-20s %-20s %-20s\n', 'Times', 'Frequency', 'Value');fprintf('%s\n', repmat('-', 1, 20*3+2));fprintf('%-20d %-20d %-20d\n', a, b, c);Output is Times Frequency Value -------------------------------------------------------------- 2 6 8 Related QuestionHow to sum every nth rowHow can I display 3 row vectors as column vectors in front of eachother using fprintfFor statement – print on exactly 1 second
Best Answer