The Kronecker Tensor Product is the result of multiplying all elements of a matrix with each of the elements of another matrix. The result is a large matrix bigger than either input matrix.
If X is m-by-n and Y is p-by-q, then mykron(X,Y) is m*p-by-n*q.
NOTE: n does not need to equal p as with normal matrix multiplication.
EX:
>> a=1:3;
>> b=2:4;
>> mykron(a,b)
ans = 2 3 4 4 6 8 6 9 12
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers51
Suggested Problems
-
Find the numeric mean of the prime numbers in a matrix.
9168 Solvers
-
All your base are belong to us
579 Solvers
-
Sum all integers from 1 to 2^n
18036 Solvers
-
Matrix which contains the values of an other matrix A at the given locations.
240 Solvers
-
Generate a string like abbcccddddeeeee
276 Solvers
More from this Author16
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
the second test case misspelled assert and is missing a close parenthesis
Thanks, I have made the corrections.
To address the term: "without using KRON", may you please add this (or something similar) to the test suite: % Test for kron usage fid = fopen(which(), 'r'); c = onCleanup(@()fclose(fid)); tline = fgetl(fid); while ischar(tline), if strfind(tline,'kron'), error('Don''t use kron'); end tline = fgetl(fid); end ... This should work fine after you've renamed your function and iserted it in <...>.
Thanks, I applied your suggestion but with some syntactical changes. Code is fully tested now so 'kron' answers disallowed.