How to plot? Having a issue.. Need to plot evolution of the norm of a symbolic matrix for t=0 to 1.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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);
t=0:0.00001:1;
plot(t,N)
Answer:
Error using plot
Data must be numeric, datetime, duration or an array
convertible to double.
Error in Q22 (line 8)
plot(t,N)
0 comentarios
Respuestas (3)
Stijn Haenen
el 7 de Dic. de 2019
you should use fplot or ezplot (https://nl.mathworks.com/help/symbolic/ezplot.html) to plot a 'sym' variable.
0 comentarios
Stijn Haenen
el 7 de Dic. de 2019
Your PHI is a 4x4 matrix, do you want to plot 16 function against t?
That can be done with:
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 ];
fplot(PHI,t)
I dont know what you want with the norm function, this norm does not work.
0 comentarios
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!