how can i return l21 value
26 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
i am unable to return the l21 values as it is saved in a string format
here is my code:
syms l21 l31 l32 u11 u12 u13 u22 u23 u33
L=[1 0 0;l21 1 0;l31 l32 1]
U=[u11 u12 u13;0 u22 u23;0 0 u33]
B=L*U
A=[2 -3 1;1 -1 -2;3 1 -1]
x=solve(A==B,[l21,l31,l32,u11,u12,u13,u22,u23,u33])
l21
0 Commenti
Risposte (1)
Dyuman Joshi
il 14 Mar 2023
As you can see above, l21 is stored as a field in the struct x. You need to use dot indexing to get its value -
syms l21 l31 l32 u11 u12 u13 u22 u23 u33
L=[1 0 0;l21 1 0;l31 l32 1];
U=[u11 u12 u13;0 u22 u23;0 0 u33];
B=L*U;
A=[2 -3 1;1 -1 -2;3 1 -1];
x=solve(A==B,[l21,l31,l32,u11,u12,u13,u22,u23,u33])
%Accessing field values via dot indexing
x.l21
x.u11
0 Commenti
Vedere anche
Categorie
Scopri di più su Numbers and Precision in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



