System of equations giving empty solution

1 次查看(过去 30 天)
How do I extract the values a, b, c, d after solving the system of equations using the following code? please note rxx(x, k) is a finite value using the command ap.a gives me Empty-sym: 0-by-1 but there exists non-zero solution to this problem. Can anyone help me please?
A = [rxx(x, 0) rxx(x, 1) rxx(x, 2) rxx(x, 3) rxx(x, 4);...
rxx(x, 1) rxx(x, 0) rxx(x, 1) rxx(x, 2) rxx(x, 3);...
rxx(x, 2) rxx(x, 1) rxx(x, 0) rxx(x, 1) rxx(x, 2);...
rxx(x, 3) rxx(x, 2) rxx(x, 1) rxx(x, 0) rxx(x, 1);...
rxx(x, 4) rxx(x, 3) rxx(x, 2) rxx(x, 1) rxx(x, 0);
];
B = zeros(1, 4);
B = [1 B]';
syms a b c d;
X = [1; a; b; c; d];
ap = solve(A*X==B);
  1 个评论
Bruno Luong
Bruno Luong 2018-11-10
but there exists non-zero solution to this problem
Sorry but I trust more in MATLAB than you.

请先登录,再进行评论。

回答(1 个)

Ashutosh Prasad
Ashutosh Prasad 2018-11-13
To solve a system of linear equation using the function 'solve', you need to input each of the equations in the symbolic representation as an argument to ‘solve’. Alternatively, you can use the ‘linsolve’ function or ‘\’ operator to solve the system of linear equations in matrix form.
Follow this link to learn more: https://www.mathworks.com/help/symbolic/solve-a-system-of-linear-equations.html

类别

Help CenterFile Exchange 中查找有关 Equation Solving 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by