フィルターのクリア

Plotting error: Need to plot the evolution of symbolic matrix?

2 ビュー (過去 30 日間)
Shauvik Das
Shauvik Das 2019 年 12 月 7 日
コメント済み: Star Strider 2019 年 12 月 7 日
syms t
PHI=[ 1, t, t/3 - (2*exp(-3*t))/9 + 2/9, (2*t)/3 + (2*exp(-3*t))/9 - 2/9;
0, 1, (5*exp(-3*t))/12 - (3*exp(t))/4 + 1/3, 2/3 - exp(t)/4 - (5*exp(-3*t))/12;
0, 0, exp(-3*t)/4 + (3*exp(t))/4, exp(t)/4 - exp(-3*t)/4;
0, 0, (3*exp(t))/4 - (3*exp(-3*t))/4, (3*exp(-3*t))/4 + exp(t)/4];
N=norm(PHI);
ezplot(N,[0,1])

採用された回答

Star Strider
Star Strider 2019 年 12 月 7 日
Try this:
PHI = @(t) [ 1, t, t/3-(2*exp(-3*t))/9+2/9, (2*t)/3+(2*exp(-3*t))/9-2/9;
0, 1, (5*exp(-3*t))/12-(3*exp(t))/4+1/3, 2/3-exp(t)/4-(5*exp(-3*t))/12;
0, 0, exp(-3*t)/4+(3*exp(t))/4, exp(t)/4-exp(-3*t)/4;
0, 0, (3*exp(t))/4-(3*exp(-3*t))/4, (3*exp(-3*t))/4+exp(t)/4];
N = @(t) norm(PHI(t));
t = linspace(0, 1, 50);
for k = 1:numel(t)
Nt(k) = N(t(k));
end
figure
plot(t, Nt)
grid
  4 件のコメント
Shauvik Das
Shauvik Das 2019 年 12 月 7 日
syms t
PHI=[ 1, -t, -t/3 - (2*exp(-3*(-t)))/9 + 2/9, (2*-t)/3 + (2*exp(-3*(-t)))/9 - 2/9;
0, 1, (5*exp(-3*(-t)))/12 - (3*exp(-t))/4 + 1/3, 2/3 - exp(-t)/4 - (5*exp(-3*(-t)))/12;
0, 0, exp(-3*(-t))/4 + (3*exp(-t))/4, exp(-t)/4 - exp(-3*(-t))/4;
0, 0, (3*exp(-t))/4 - (3*exp(-3*(-t)))/4, (3*exp(-3*(-t)))/4 + exp(-t)/4];
PHIT=transpose (PHI);
B=[0;1;2;1];
BT=transpose (B);
GRAMi = PHI*B*BT*PHIT
GRAMfinal=int(GRAMi,t, 0, t)
A= det(GRAMfinal)
N = @(t) (A(t));
t = linspace(0, 1, 50);
for k = 1:numel(t)
Nt(k) = N(t(k));
end
figure
plot(t, Nt)
grid
%% Not sure why is it not plotting determinant of the matrix in the same way.
Star Strider
Star Strider 2019 年 12 月 7 日
Try this:
PHI = @(t) [ 1, t, t/3-(2*exp(-3*t))/9+2/9, (2*t)/3+(2*exp(-3*t))/9-2/9;
0, 1, (5*exp(-3*t))/12-(3*exp(t))/4+1/3, 2/3-exp(t)/4-(5*exp(-3*t))/12;
0, 0, exp(-3*t)/4+(3*exp(t))/4, exp(t)/4-exp(-3*t)/4;
0, 0, (3*exp(t))/4-(3*exp(-3*t))/4, (3*exp(-3*t))/4+exp(t)/4];
PHIT = @(t) transpose(PHI(t));
B=[0;1;2;1];
BT=transpose(B);
GRAMi = @(t) PHI(t)*B*BT*PHIT(t);
GRAMfinal = @(t) integral(GRAMi, 0, t, 'ArrayValued',1)
A = @(t) det(GRAMfinal(t));
N = @(t) (A(t));
t = linspace(0, 1, 50);
for k = 1:numel(t)
Nt(k) = N(t(k));
end
figure
plot(t, Nt)
grid
That ran without error for me, and appears to do what you want.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by