I want to make an array of A having both subscript and superscript as a number. Can you help me?

1 回表示 (過去 30 日間)
q= sym('q%d^%d',[4,4]);

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 3 月 19 日
q = zeros(4,4,'sym');
for sub = 1 : 4
subsym = feval(symengine, 'Symbol::subScript', sym('q'), sub);
for sup = 1 : 4
q(sub, sup) = feval(symengine, 'Symbol::superScript', subsym, sup);
end
end
  3 件のコメント
Walter Roberson
Walter Roberson 2018 年 3 月 19 日
Use .' instead of '
The ' operator is conjugate transpose.

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

Community Treasure Hunt

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

Start Hunting!

Translated by