kronecker product in a matrix

4 ビュー (過去 30 日間)
Ali Esmaeilpour
Ali Esmaeilpour 2019 年 5 月 14 日
編集済み: Geoff Hayes 2019 年 5 月 30 日
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 件のコメント
madhan ravi
madhan ravi 2019 年 5 月 14 日

サインインしてコメントする。

採用された回答

Geoff Hayes
Geoff Hayes 2019 年 5 月 30 日
編集済み: Geoff Hayes 2019 年 5 月 30 日
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 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by