# MATLAB: How would i solve for t2 and t3 in the last matrix? ive never dealt with variables in matrices before.

matricesmatrixvariables

l1 = .1; %ml2 = .06; %ml3 = .08; %mk1 = 5 ; %W/m*Ck2 = .8 ; %W/m*Ck3 = 15 ; %W/m*CK1 = (k1/l1) * [1 -1 ; -1 1] %W/CK2 = (k2/l2) * [1 -1 ; -1 1] %W/CK3 = (k3/l3) * [1 -1 ; -1 1] %W/Ckg = [ K1(1,1) K1(1,2) 0 0 ;    K1(2,1) (K1(2,2)+K2(1,1)) K2(1,2) 0 ;    0 K2(2,1) (K2(2,2)+K3(1,1)) K3(1,2);    0 0 K3(2,1) K3(2,2)]f = [ 0;0;0;0]t= [500 ; t2 ; t3 ; 100 ]f = kg * t

• Sorry. But no solution exists. You have 4 equations, in only two unknowns.
l1 = .1; %ml2 = .06; %ml3 = .08; %mk1 = 5 ; %W/m*Ck2 = .8 ; %W/m*Ck3 = 15 ; %W/m*CK1 = (k1/l1) * [1 -1 ; -1 1] %W/CK2 = (k2/l2) * [1 -1 ; -1 1] %W/CK3 = (k3/l3) * [1 -1 ; -1 1] %W/Ckg = [ K1(1,1) K1(1,2) 0 0 ;    K1(2,1) (K1(2,2)+K2(1,1)) K2(1,2) 0 ;    0 K2(2,1) (K2(2,2)+K3(1,1)) K3(1,2);    0 0 K3(2,1) K3(2,2)]f = [ 0;0;0;0]syms t2 t3t= [500 ; t2 ; t3 ; 100 ]
Now, look at kg*t.
kg*tans =                   25000 - 50*t2  (190*t2)/3 - (40*t3)/3 - 25000 (1205*t3)/6 - (40*t2)/3 - 18750              18750 - (375*t3)/2
Each of those result must be equal to 0. So 4 equations. But only two unknowns: t2 and t3.
No solution exists.
t23 = solve(f == kg*t)t23 =   struct with fields:    t2: [0×1 sym]    t3: [0×1 sym]
As you can see, MATLAB tells us no solution exists. t2 and t3 are empty.