gpt4 book ai didi

matlab - 在 MATLAB 中求齐次系统的解

转载 作者:行者123 更新时间:2023-12-02 09:51:02 25 4
gpt4 key购买 nike

MATLAB 中 A*x=b 的通解由下式给出

x=A\b

例如

A = [2 -1 1; 1 2 3; 3 0 -1]

A =

2 -1 1
1 2 3
3 0 -1

b = [8; 9; 3]

b =

8
9
3

x = A\b

x =

2.0000
-1.0000
3.0000

系统A*x=0的解决方案怎么样?请帮助我

奇异矩阵测试

A=[1 2 3;2 1 4;3 3 7]

A =

1 2 3
2 1 4
3 3 7

>> det(A)

ans =

0
b=[0;0;0];
>> linsolve(A,b)
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 1.903239e-017.

ans =

0
0
0

@罗伯特·P.

这是正确的吗?

A=[2 3 1;-1 3 1;1 6 2]

A =

2 3 1
-1 3 1
1 6 2

>> det(A);
>> det(A)

ans =

0

>> [U S V]=svd(A);
>> x=V(:,end);
>> A*x

ans =

1.0e-015 *

0.2220
0.2220
0.4441

最佳答案

您可以使用Singular value decomposition , svd如果存在非平凡的解决方案,则获得满足 Ax=0x:

A = [2 -1 1; 2 -1 1; 3 2 1];
[U S V] = svd(A);
x = V(:,end)

x =

-0.39057
0.13019
0.91132

A*x =

0
0
0

关于matlab - 在 MATLAB 中求齐次系统的解,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19548611/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com