matlab求矩阵Ax=b的解,A为3阶魔方阵,b是(3×1)全1列向量。用rref,inv/体验
2个回答
展开全部
>> A = magic(3)
A =
8 1 6
3 5 7
4 9 2
>> b = ones(3,1)
b =
1
1
1
>> x1 = inv(A)*b
x1 =
0.0667
0.0667
0.0667
>> x2 = A\b
x2 =
0.0667
0.0667
0.0667
>> [R,jb] = rref(A)
R =
1 0 0
0 1 0
0 0 1
jb =
1 2 3
A =
8 1 6
3 5 7
4 9 2
>> b = ones(3,1)
b =
1
1
1
>> x1 = inv(A)*b
x1 =
0.0667
0.0667
0.0667
>> x2 = A\b
x2 =
0.0667
0.0667
0.0667
>> [R,jb] = rref(A)
R =
1 0 0
0 1 0
0 0 1
jb =
1 2 3
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询