如何使用MATLAB求解二元一次矩阵方程a=[0,0,-1,0,0;-0.558,-0.097,-0.903,-0.472,0;0,-1,0,0,0;0,0,0,0,0;0,0,0,0,0]b=[0,0,1,0,-0.02;0.7,0,1,0.476,0.0048;-2.95,-0.568,1.568,-2.758,0;0,0,0,0.0199,0.0101;0,1,0,0,0]c=[0,0,0,0,0;-0.053,0,0,0,0;3.4
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 16:53:04
如何使用MATLAB求解二元一次矩阵方程a=[0,0,-1,0,0;-0.558,-0.097,-0.903,-0.472,0;0,-1,0,0,0;0,0,0,0,0;0,0,0,0,0]b=[0,0,1,0,-0.02;0.7,0,1,0.476,0.0048;-2.95,-0.568,1.568,-2.758,0;0,0,0,0.0199,0.0101;0,1,0,0,0]c=[0,0,0,0,0;-0.053,0,0,0,0;3.4
如何使用MATLAB求解二元一次矩阵方程
a=[0,0,-1,0,0;-0.558,-0.097,-0.903,-0.472,0;0,-1,0,0,0;0,0,0,0,0;0,0,0,0,0]
b=[0,0,1,0,-0.02;0.7,0,1,0.476,0.0048;-2.95,-0.568,1.568,-2.758,0;0,0,0,0.0199,0.0101;0,1,0,0,0]
c=[0,0,0,0,0;-0.053,0,0,0,0;3.4897,0,0,2.786,0.0277;0,0,0,0,0;0,-1,0,0,0;]
求解的方程形式为ax^2-bx+c=0 希望有人能写出代码
如何使用MATLAB求解二元一次矩阵方程a=[0,0,-1,0,0;-0.558,-0.097,-0.903,-0.472,0;0,-1,0,0,0;0,0,0,0,0;0,0,0,0,0]b=[0,0,1,0,-0.02;0.7,0,1,0.476,0.0048;-2.95,-0.568,1.568,-2.758,0;0,0,0,0.0199,0.0101;0,1,0,0,0]c=[0,0,0,0,0;-0.053,0,0,0,0;3.4
这应该是一元二次方程吧
clear all
clc
a=[0,0,-1,0,0;-0.558,-0.097,-0.903,-0.472,0;0,-1,0,0,0;0,0,0,0,0;0,0,0,0,0];
b=[0,0,1,0,-0.02;0.7,0,1,0.476,0.0048;-2.95,-0.568,1.568,-2.758,0;0,0,0,0.0199,0.0101;0,1,0,0,0];
c=[0,0,0,0,0;-0.053,0,0,0,0;3.4897,0,0,2.786,0.0277;0,0,0,0,0;0,-1,0,0,0;];
result=solve('a*x^2-b*x+c=0');
x1=eval(result(1));%x1、x2就是两个根
x2=eval(result(1));