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 Solvers49
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15786 Solvers
-
2050 Solvers
-
1912 Solvers
-
How long do each of the stages of the rocket take to burn?
465 Solvers
-
Simple date to serial no. conversion
134 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.