Solving 4 equations with 4 unknowns

Hi,
I would use a little help. I have 4 equations with 4 unknowns and I need to solve them to get the answer to the 4 unknowns. How can I do that ? I have no idea how to do that in Matlab.
I tried to use "solve" function but I m getting no answer...How are you doing that ? I bet a lot of people have many applications where do the same of simillar thing...
I used:
%syms x y z T;
%x = solve(eq1, 'x');
%y = solve(eq2, 'y');
%z = solve(eq3, 'z');
%T = solve(eq4, 'T');
for extracting the specific unknown but I don't know what to do next...
and than I tried this with no solution...
syms x y z T
S = solve(eq1, eq2, eq3, eq4)
Thanks, Peter

6 Comments

I have these 4 equations:
(x-const)^2+(y-const)^2+(z-const)^2=(const*(t+const))^2
(x-const)^2+(y-const)^2+(z-const)^2=(const*(t+const))^2
(x-const)^2+(y-const)^2+(z-const)^2=(const*(t+const))^2
(x-const)^2+(y-const)^2+(z-const)^2=(const*(t+const))^2
constants change of course... I stil get error
??? Comma separated list expansion has cell syntax for an array that is not a cell.
Please show the exact line of code that is giving that error.
Which MATLAB version are you using?
Please show how you constructed one of the equations.
??? Comma separated list expansion has cell syntax for an array that is not a cell.
Error in ==> sym.sym>sym.subsref at 1364 [inds{k},refs{k}] = privformat(inds{k});
Error in ==> TEST at 53 sol.x
I am using Matlab 7.10.0 (R2010a)...
Walter Roberson
Walter Roberson on 25 Nov 2012
Edited: Walter Roberson on 25 Nov 2012
Please show how you constructed one of the equations.
Also, is the above on a solve() call or a different call?
So the error is not in the solve() call itself, right?
What does
class(sol)
show?
If it shows up as a structure, try
char(sol.x)
That set of equations has no solutions. If you solve the first two parts to get x and y, and substitute that into the third and fourth part, the z drops out of both parts. You can solve for t, and the answers will be consistent. The implication is that you only really have three different equations, and z can be anything.

Sign in to comment.

 Accepted Answer

Walter Roberson
Walter Roberson on 25 Nov 2012
We need more information about the form of the equations.
Not every set of equations has a solution, even for simple linear algebra -- the set might be rank deficient.
More complicated equations might be beyond the analytical ability of MuPAD to resolve, or there might be no method at all to find analytical solutions (e.g., polynomials of degree 5 and higher are not certain to have any analytical solution.)
Equations involving trig are usually difficult to solve analytically.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!