kronecker product in a matrix

2 visualizaciones (últimos 30 días)
Ali Esmaeilpour
Ali Esmaeilpour el 14 de Mayo de 2019
Editada: Geoff Hayes el 30 de Mayo de 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

Respuesta aceptada

Geoff Hayes
Geoff Hayes el 30 de Mayo de 2019
Editada: Geoff Hayes el 30 de Mayo de 2019
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

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by