Error using reshape (line 16)
Size vector must have at least two elements.
Error in find (line 35)
Error in kron (line 31)
Error in bug (line 4)
kron(X, eye(2));
29 error( e2 );
As a workaround, use the following kron implementation, written using an outer product:
function res = workaroundkron(x, y)
x1 = size(x, 1);
x2 = size(x, 2);
y1 = size(y, 1);
y2 = size(y, 2);
res = y(:) * x(:)';
res = reshape(res, [y1 y2 x1 x2]);
res = permute(res, [1 3 2 4]);
res = reshape(res, [y1*x1 y2*x2]);
end
Note: I have done minimal testing of this workaround, use at your own risk.