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 Solvers50
Suggested Problems
-
Find the "ordinary" or Euclidean distance between A and Z
177 Solvers
-
Sum of diagonal of a square matrix
1640 Solvers
-
Sum of first n terms of a harmonic progression
517 Solvers
-
Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
253 Solvers
-
Determine the number of odd integers in a vector
836 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.