question about solving system of equations using symbolic math
问题 I want to use symbolic symbol to solve a system of linear equation. So I prepare the following code. A=[1,2;3,4]; % syms x x=sym('x_%d',[2 1]); eqn=A*x==[1;2]; result=solve(eqn,x) Interestingly, it works, but when I read the variable result, it gives a 1X1 struct with x_1 and x_2 are 1X1 sym. But what I expect get should be 2 real values, why? Could someone explain it? Remark: do not want to use A^-1*[1;2] to obtain the answer. 回答1: If you set the output to single variable solve returns a