System of equations giving empty solution
1 view (last 30 days)
Show older comments
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 Comment
Bruno Luong
on 10 Nov 2018
but there exists non-zero solution to this problem
Sorry but I trust more in MATLAB than you.
Answers (1)
Ashutosh Prasad
on 13 Nov 2018
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
0 Comments
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!