Borrar filtros
Borrar filtros

シンボリック変数を用​いて解いた連立方程式​の解の表示形式につい​て

7 visualizaciones (últimos 30 días)
ZONZON
ZONZON el 24 de Sept. de 2016
Editada: michio el 24 de Sept. de 2016
シンボリック変数を用いて以下のように連立1次方程式を解きました。
この時の解の表示形式に関する質問です。
syms x y;
[solx,soly] = solve(y-a*x-b == 0, y-c*x-d == 0);
※a,b,c,dは定数として定義済み 計算後,コマンドウインドウでsolx,solyを表示させると, 分数表示になり,シンボリック変数としてワークスペースに登録された状態になります。
これ以降の計算で,solx,solyを利用する都合上, シンボリック変数ではなく, 通常の変数に変更したい(さらに指数表示にしたい)のですが, これは可能でしょうか?
  1 comentario
Walter Roberson
Walter Roberson el 24 de Sept. de 2016
Approximate translation:
By using a symbolic variable has solved the system of linear equations as follows.
I have a question about the display format of the solution at this time.
syms x y;
[Solx, soly] = solve (y-a * x-b == 0, y-c * x-d == 0);
a, b, c, d after the pre-defined calculation as a constant, solx in the command window, and to display the soly, it becomes a fraction display will be in the state that has been registered in the workspace as a symbolic variable.
In this subsequent calculations, solx, the convenience to use the soly, rather than the symbolic variables, you want to change to the normal variables (still want to index display) you, this is possible?

Iniciar sesión para comentar.

Respuesta aceptada

michio
michio el 24 de Sept. de 2016
Editada: michio el 24 de Sept. de 2016
double を使うとMATLAB 数値形式に変換できます。
expr = (1+sqrt(sym(5)))/2;
expr = double(expr)
format shortE
expr
format でコマンドウィンドウ上への表示形式を指定できます。

Más respuestas (1)

Walter Roberson
Walter Roberson el 24 de Sept. de 2016
I think you might be looking for subs()
For example,
subs(soly, {a, b, c, d}, {27, 48, 53.2, pi})

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by