MATLAB: Solving system of equaitons

plotsolvesystem of equation

I need to solve three equations and three unknowns (three forces, F_)so I can plot the forces.
d=[0:50];
P=40,000;
syms F_ab F_cd F_fg
solve(F_ab+F_cd+F_fg==-P) %equation 1
solve(10*F_ab+28*F_cd+40*F_fg==-d*P) %equation 2
solve(144*F_ab-240*F_cd+180*F_fg==0) %equation 3
plot(d,F_ab,'k',d,F_cd,'r',d,F_fg,'b')
The code is not solving anything… please help.

Best Answer

for d=0:50
P=40,000;
syms F_ab F_cd F_fg
sol=solve(F_ab+F_cd+F_fg+P,10*F_ab+28*F_cd+40*F_fg+d*P,144*F_ab-240*F_cd+180*F_fg);
s1(d+1)=double(subs(sol.F_ab));
s2(d+1)=double(subs(sol.F_cd));
s3(d+1)=double(subs(sol.F_fg));
end
d=0:50
plot(d,s1,'k',d,s2,'r',d,s3,'b')