How to plot? Having a issue.. Need to plot evolution of the norm of a symbolic matrix for t=0 to 1.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (3)
Stijn Haenen
le 7 Déc 2019
you should use fplot or ezplot (https://nl.mathworks.com/help/symbolic/ezplot.html) to plot a 'sym' variable.
0 commentaires
Stijn Haenen
le 7 Déc 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 commentaires
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!