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

1 Ansicht (letzte 30 Tage)
Mitchell
Mitchell am 24 Jun. 2016
Beantwortet: Walter Roberson am 24 Jun. 2016
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?

Antworten (1)

Walter Roberson
Walter Roberson am 24 Jun. 2016
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

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by