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
-
3410 Solvers
-
1251 Solvers
-
Volume of a sphere given its surface area
155 Solvers
-
805 Solvers
-
Celsius to Fahrenheit converter
674 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.