How to find the Elements of a Coefficient Matrix?

52 ビュー (過去 30 日間)
ercan duzgun
ercan duzgun 2020 年 12 月 11 日
回答済み: RUTUPURNA CHOUDHURY 2021 年 9 月 1 日
How to find the matrix coefficients of an equation? For example think that we have an equation of "E=A+Ax^2+Bx+Cx+Cx^2+Ay+Ay^2+By^2". We might choose a row matrix of M=[1 x x^2 y y^2]' . In order to have E=N*M, what elements of N should be? (E is 1x1 matrix, M=5x1 matrix, N=1x5 matrix). (by using MATLAB symbolic toolbox)
Solution by hand:
E=(A)*x^0 + (B+C)*x^1 + (A+C)x^2 + (A)*y + (A+B)*y^2;
Therefore;
N=[A (B+C) (A+C) A (A+B)]; (The solution)
E=N*M=[A (B+C) (A+C) A (A+B)]*[1 x x^2 y y^2]' = A+Ax^2+Bx+Cx+Cx^2+Ay+Ay^2+By^2.

採用された回答

Sai Veeramachaneni
Sai Veeramachaneni 2020 年 12 月 14 日
Hi,
You can leverage coeffs function to find coefficients of an equation.
Example-
syms A B C x y
E=A+A*x^2+B*x+C*x+C*x^2+A*y+A*y^2+B*y^2;
[N,M]=coeffs(E,[x y])
  1 件のコメント
ercan duzgun
ercan duzgun 2020 年 12 月 14 日
Dear Sai Veeramachaneni, thank you very much.

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

その他の回答 (1 件)

RUTUPURNA CHOUDHURY
RUTUPURNA CHOUDHURY 2021 年 9 月 1 日
How can we find the cofficient matrix from a non-linear equation ?
Note: Like equations to matrix command used for linear system of equatins. Like this what command used for non-linear equations?

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by