MATLAB Answers

0

kronecker product in a matrix

Asked by Ali Esmaeilpour on 14 May 2019
Latest activity Edited by Geoff Hayes
on 30 May 2019
hx = [-1/sqrt(5);-2/sqrt(5)] and hu = [0;0] and i = 1 and N = 5
I want to find a code for hk, tnx!4.png

  1 Comment

Sign in to comment.

Products


Release

R2016b

1 Answer

Answer by Geoff Hayes
on 30 May 2019
Edited by Geoff Hayes
on 30 May 2019
 Accepted Answer

Ali - perhaps the code could be
h = zeros((2*N + 1) * size(hx,1), N);
for k=1:N
Ekn1 = zeros(N,1);
Ekn1(k) = 1;
Ekn2 = zeros(N+1,1);
Ekn2(k) = 1;
h(:,k) = [kron(Ekn2,hx);kron(Ekn1,hu)];
end

  0 Comments

Sign in to comment.