equation set:
Scilab solve code:
-->A = [1 -3 -2 -1; 3 -8 1 5; -2 1 -4 1; -1 4 -1 -3]
-->b = [-6; 0; 12; -2]
-->linsolve(A, b)
Notice,
- The way to define a matrix in Scilab, the rows are separated by semicolons, but the elements in a row are separated by spaces
- matrix b, the result of shifting the constant column to the left of the equal sign
- function name
linsolve
instead of linesolve
The actual output of executing the above code is as follows:
-->A = [1 -3 -2 -1; 3 -8 1 5; -2 1 -4 1; -1 4 -1 -3]
A =
1. - 3. - 2. - 1.
3. - 8. 1. 5.
- 2. 1. - 4. 1.
- 1. 4. - 1. - 3.
-->b = [-6; 0; 12; -2]
b =
- 6.
0.
12.
- 2.
-->linsolve(A, b)
ans =
2.
- 1.
1.
- 3.