MATLAB: Basic matrix equation Ax=B with restrictions

MATLABmatrix solve restrictions

Hi! Im modeling a truss using FEM and im trying to solve a very basic equation A*x=b where a is the stiffness matrix , x and b are the displacements and forces vectors. So A and b are known and i want to find x, the displacements. I know i could type x=b/A in matlab, the thing is i know some of the entries of the x vector due to boundary conditions, and typing a=b/A it works as if all x entries where unknowns. Is there a function to do this in MATLAB ?
Thanks a lot!!
Pd: Sorry for my poor english!

Best Answer

x = [ x1 ; x2 ]% x2 known
A = [ A1 A2 ]% A1 & A2 known
A*x = A1*x1 + A2*x2 % last term known
A1*x1 = b - A2*x2
Voila!
Hope this helps.
Greg
P.S. Ain't Linear Systems grand?
Related Question