How to create a symbolic matrix where each entry is a function of time?

1 回表示 (過去 30 日間)
Mitchell
Mitchell 2016 年 6 月 24 日
回答済み: Walter Roberson 2016 年 6 月 24 日
I am trying to create a matrix where each entry of the matrix is a function of time. For example, this is what I want the output to look like:
A =
[ A1_1(t), A1_2(t)]
[ A2_1(t), A2_2(t)]
I have tried:
syms t
A = sym('A(t)', [2 2])
but this does not work. Any suggestions?

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 6 月 24 日
A = sym(zeros(2,2));
for J = 1 : size(A,1)
for K = 1 : size(A,2)
A(J,K) = feval(symengine,sprintf('A%d_%d', J, K), 't');
end
end

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by