Trying to simultaneously solve the following, but I'm getting the following error, can someone please tell me how to fix it?

2 ビュー (過去 30 日間)
>> syms F
>> syms G
>> [F G]=solve('2*(F^2)*(G^2)+3*G=13.8','2*(G^3)+(F^2)=16.6')
The following is the error I get when I click enter:
Check for incorrect argument data type or missing argument in call to function 'solve'.

回答 (1 件)

chicken vector
chicken vector 2023 年 4 月 26 日
Try this syntax:
syms F G
eqn = [2 * F^2 * G^2 + 3 * G == 13.8 , 2 * G^3 + F^2 == 16.6];
sol = solve(eqn, [F G])
If you receive the error:
Undefined function 'sym' for input arguments of type 'char'
You don't have the Symbolic Math Toolbox and you need to install it.
Type ver in the command window to see the Toolboxes you have.
If you can't find the symbolic toolbox, type syms x in the command window and it will be suggested to you.
  9 件のコメント
Torsten
Torsten 2023 年 4 月 26 日
編集済み: Torsten 2023 年 4 月 26 日
I listed the solutions for your interest (see above).
If you want P and F to be real-valued, replace
syms P F
by
syms P F real
and you will only get one solution pair.
Walter Roberson
Walter Roberson 2023 年 4 月 26 日
syms P F
eqn = [sym(13)/10 * P - F^(sym(21)/10) == 0 , P^(sym(16)/10) - (sym(900) - sym(95) * F)^(sym(5)/10) + sym(10) == 0];
sol = solve(eqn)
sol.P
sol.F
This produces two complex-valued solutions.
Representation matters for symbolic purposes.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEquation Solving についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by