Create a multiplication table and write it to a spreadsheet
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:9| Question number:4.9
All Answers
total answers (1)
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:9| Question number:4.9
total answers (1)
Ch9Ex4.m
% Write a multiplication table to a spreadsheet
%Initialize multiplication table
mat = zeros(101,101);
mat(1,2:end) = 1:100; %Row header
mat(2:end,1) = 1:100; %Column header
%Create multiplication table
for i = 1:100
for j = 1:100
mat(i+1,j+1) = i*j;
end
end
xlswrite('multable.xls', mat)
need an explanation for this answer? contact us directly to get an explanation for this answer