## how to solve a system of equations with n equation and m unknown (m>n)?

nasrin

### nasrin (view profile)

さんによって質問されました 2012 年 7 月 25 日

### MJTHDSN (view profile)

さんによって コメントされました 2018 年 4 月 12 日
to solve this equation "f = a+b θs + c θv cos(φ)" : unknowns are : f, a, b & c i am working on space image and can calculate θs, θv & φ for all pixel of image so i can write a lot of equation. and there are 2 constraint :
How do I solve this system of equations?

Greg Heath

### Greg Heath (view profile)

25 Jul 2012
to solve this equation "y = a+b x" : unknowns are : y, a & b i can calculate x for all points of interest so i can write a lot of equation...
Do you see a problem here?
Jan

### Jan (view profile)

on 25 Jul 2012
Dear nasrin, of course we cannot access the files on your harddisk. Imagine what this would mean!
nasrin

### nasrin (view profile)

on 25 Jul 2012
sorry, it was wrong. link : http://postimage.org/image/4a0qy3973/

サインイン to comment.

## 1 件の回答

Sargondjani

### Sargondjani (view profile)

님의 답변 25 Jul 2012

i think fmincon (constrained optimization) will work best... if you try to minimize some error use as the objective: objective=error^2.
if you dont have the optimization toolbox you can try fminsearchcon from the file exchange (but this only works properly for a couple of variables at most)
note that fmincon can only find one local solution and it requires a continuous function + continuous derivate. if not continuous, then you should try genetic algorithm

nasrin

### nasrin (view profile)

25 Jul 2012
my system of equation have n equation and (n+3) unknown (because f vary in each equation) and my constraints are just for "f" and one of two constraint is about the sum of the values obtained for "f" there is not exist "fminsearchcon". and "fminsearch" is unconstrainted function method.
Sargondjani

### Sargondjani (view profile)

31 Jul 2012
fminsearchcon does exist in the 'file exchange', ie. you have to download it.
MJTHDSN

### MJTHDSN (view profile)

on 12 Apr 2018
Dear Matlabers,
I have a similar question but a little bit confusing. Let`s assume we have 6 equations as below:
EQ1:a{{(L^2)*(Z^2)+(L^2)*(M^2)-2*L*(Z^2)+(Z^2)}}=(L^2)*(T^2)-2*L*(T^2)+ (T^2)-(2*L*T*B)+(T*B)+(B^2)
EQ2: b{{(L^2)*(Z^2)+(L^2)*(M^2)-2*L*(Z^2)+(Z^2)}}=(L^2)*(T^2)+(2*L*T*B)+(B^2)
EQ3: c{{(L^2)*(Z^2)+(L^2)*(M^2)-2*L*(Z^2)+(Z^2)}}=(T^2)+(2*T*B)+(B^2)
EQ4:d{{(L^2)*(Z^2)+(L^2)*(M^2)-2*L*(Z^2)+(Z^2)}}=(L^2)*(T^2)-2*L*(T^2)+ (T^2)-(2*L*T*B)-(T*B)+(B^2)
EQ5: e{{(L^2)*(Z^2)+(L^2)*(M^2)-2*L*(Z^2)+(Z^2)}}=(L^2)*(T^2)-(2*L*T*B)+(B^2)
EQ6: f{{(L^2)*(Z^2)+(L^2)*(M^2)-2*L*(Z^2)+(Z^2)}}=(T^2)-(2*T*B)+(B^2)
in the equations above a,b,c,d,e and f are the numerical known values (0.543 for example). So we have 6 equations with 5 unknowns as L, Z, M, T and B.
Can you please give me cues how to solve the equations to find these unknowns using MATLAB.
Best Regards,

サインイン to comment.