How do I convert my symbolic equations to matrix form while preserving my order of variables?
    4 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    MathWorks Support Team
    
 am 10 Sep. 2018
  
    
    
    
    
    Beantwortet: MathWorks Support Team
    
 am 14 Mai 2019
            I have a system of equations with variables that are numbered (m1, m2, ... , m12). When I use "equationsToMatrix", I want to preserve this order, how do I do this?
Akzeptierte Antwort
  MathWorks Support Team
    
 am 15 Mai 2019
        By specifying the variables as the second input to "equationsToMatrix", the conversion will preserve that order. Here is an example:
syms m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12
eqns=[m1-m2-m3-m4-m5==0,
m2-m9-m10-m11==0,
m5-m8-m7-m6==0,
m12-m4-m7-m11==0,
m1==100,
m5-5*m8==0,
0.84*m12-m4-m7==0,
0.7*m1-m2-m3==0,
0.55*m1-m9-m12==0,
0.2*m9-m10==0,
0.85*m2-m9-m11==0,
3.2*m6-m7-m8==0];
vars = [m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12]; % Specify the variable order here
[A,b]=equationsToMatrix(eqns,vars)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Logical finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!