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

norm of a symbolic matrix

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])

Best Answer

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