We can solve these two linear equations using the matrix form Ax = b, where A contains coefficients of unknowns, x contains unknowns itself, and b contains constant terms. Here,
main.m108 chars4 lines
In MATLAB, we can solve it using the linsolve function:
main.m18 chars2 lines
This will give us the values of cos(θ3) and cos(θ4). To get the values of θ3 and θ4, we will use the acos function:
main.m27 chars2 lines
The acos function returns the angle in radians, so we convert it to degrees by multiplying with 180/pi.
Note that there might be multiple solutions to this problem, so it's a good idea to check if the values we get satisfy the original equations.
gistlibby LogSnag