Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,3 @@
function table = timesTable(N)
table = [(0:N); (1:N)' triu( kron((1:N),(1:N)') )];
end

View file

@ -0,0 +1,17 @@
function table = timesTable(N)
%Generates a column vector with integers from 1 to N
rowLabels = (1:N)';
%Generate a row vector with integers from 0 to N
columnLabels = (0:N);
%Generate the multiplication table using the kronecker tensor product
%of two vectors one a column vector and the other a row vector
table = kron((1:N),(1:N)');
%Make it upper triangular and concatenate the rowLabels and
%columnLabels to the table
table = [columnLabels; rowLabels triu(table)];
end