create a miltiplication table in matlab

main.m
% Define the size of the multiplication table
n = 10;

% Initialize a matrix to store the multiplication table
mult_table = zeros(n);

% Generate the multiplication table
for i = 1:n
    for j = 1:n
        mult_table(i, j) = i * j;
    end
end

% Display the multiplication table
disp(mult_table);
299 chars
16 lines

related categories

gistlibby LogSnag