当前位置:网站首页>Matlab在线性代数中的应用
Matlab在线性代数中的应用
2022-07-17 01:45:00 【阿强真】
Matlab在线性代数中的应用
求向量组的线性相关组
例:求下列矩阵列向量的一个最大无关组:
A = [ 1 − 2 1 0 2 − 2 4 2 6 − 6 2 − 1 0 2 3 3 3 3 3 4 ] A=\left[ \begin{matrix} 1& -2& 1& 0& 2\\ -2& 4& 2& 6& -6\\ 2& -1& 0& 2& 3\\ 3& 3& 3& 3& 4\\ \end{matrix} \right] A=⎣⎡1−223−24−13120306232−634⎦⎤
加粗样式
format rat
a=[1,-2,-1,0,2;
-2,4,2,6,-6;
2,-1,0,2,3;
3,3,3,3,4];
b=rref(a)

记矩阵 A 的五个列向量依次为 α 1 , α 2 , α 3 , α 4 α 5 , 则 α 1 , α 2 , α 3 是列向量的一个最大无关组 \text{记矩阵}A\text{的五个列向量依次为}\alpha _1,\alpha _2,\alpha _3,\alpha _4\alpha _5,\text{则}\alpha _1,\alpha _2,\alpha _3\text{是列向量的一个最大无关组} 记矩阵A的五个列向量依次为α1,α2,α3,α4α5,则α1,α2,α3是列向量的一个最大无关组
求解齐次方程组
{ x 1 + 2 x 2 + 2 x 3 + x 4 = 0 2 x 1 + x 2 − 2 x 3 − x 4 = 0 x 1 − x 2 − 4 x 3 − 3 x 4 = 0 \begin{cases} x_1+2x_2+2x_3+x_4=0\\ 2x_1+x_2-2x_3-x_4=0\\ x_1-x_2-4x_3-3x_4=0\\ \end{cases} ⎩⎨⎧x1+2x2+2x3+x4=02x1+x2−2x3−x4=0x1−x2−4x3−3x4=0
a=[1 2 2 1
2 1 -2 -2
1 -1 -4 -3]
b=null(a,"r")

通解为: k 1 [ 2 , − 2 , 1 , 0 ] T + k 2 [ 5 / 3 , − 4 / 3 , 0 , 1 ] T , k 1 , k 2 ∈ R \text{通解为:}k_1\left[ 2,-2,1,0 \right] ^T+k_2\left[ 5/3,-4/3,0,1 \right] ^T\,\,,k_1,k_2\in \mathrm{R} 通解为:k1[2,−2,1,0]T+k2[5/3,−4/3,0,1]T,k1,k2∈R
求解非齐次方程组
例1:
{ x 1 + x 2 = 1 x 1 + x 3 = 2 x 1 + x 2 + x 3 = 0 x 1 + 2 x 2 − x 3 = − 1 \begin{cases} x_1+x_2=1\\ x_1+x_3=2\\ x_1+x_2+x_3=0\\ x_1+2x_2-x_3=-1\\ \end{cases} ⎩⎨⎧x1+x2=1x1+x3=2x1+x2+x3=0x1+2x2−x3=−1
即 x 1 = 17 6 , x 2 = − 13 6 , x 3 = − 2 3 \text{即}x_1=\frac{17}{6}\text{,}x_2=-\frac{13}{6}\text{,}x_3=-\frac{2}{3} 即x1=617,x2=−613,x3=−32
format rat
a=[1 1 0
1 0 1
1 1 1
1 2 -1]
b=[1; 2; 0; -1]
x1=a\b
x2=pinv(a)*b%方法二
例2:
{ x 1 − x 2 − x 3 + x 4 = 0 x 1 − x 2 + x 3 − 3 x 4 = 1 x 1 − x 2 − 2 x 3 + 3 x 4 = − 1 2 \begin{cases} x_1-x_2-x_3+x_4=0\\ x_1-x_2+x_3-3x_4=1\\ x_1-x_2-2x_3+3x_4=-\frac{1}{2}\\ \end{cases} ⎩⎨⎧x1−x2−x3+x4=0x1−x2+x3−3x4=1x1−x2−2x3+3x4=−21
a=[1 -1 -1 1 0
1 -1 1 -1 1
1 -1 -2 3 -1/2]
b=rref(a)

该方程组有解,并有:
{ x 1 = x 2 + x 4 + 1 2 x 3 = 2 x 4 + 1 2 \begin{cases} x_1=x_2+x_4+\frac{1}{2}\\ x_3=2x_4+\frac{1}{2}\\ \end{cases} { x1=x2+x4+21x3=2x4+21
从而该方程组的通解为:
[ x 1 , x 2 , x 3 , x 4 ] T = k 1 [ 1 , 1 , 0 , 0 ] T + k 2 [ 1 , 0 , 2 , 1 ] T + [ 1 2 , 0 , 1 2 , 0 ] T \left[ x_1,x_2,x_3,x_4 \right] ^T=k_1\left[ 1,1,0,0 \right] ^T+k_2\left[ 1,0,2,1 \right] ^T+\left[ \frac{1}{2},0,\frac{1}{2},0 \right] ^T [x1,x2,x3,x4]T=k1[1,1,0,0]T+k2[1,0,2,1]T+[21,0,21,0]T
边栏推荐
- 本地存储localStorage⽤法详解
- Chengxin University envi_ IDL second week homework: extract aerosol thickness at n points + detailed analysis
- ResNet
- 动态管理内存的通讯录实现
- Labelme starts normally, but cannot be opened
- laravel的问题
- Configure high availability using virtual ip+kept
- Leetcode: dynamic programming [basic problem solving]
- 上班摸鱼打卡模拟器微信小程序源码
- My most productive easypypi once again has been updated! V1.4.0 release
猜你喜欢

Using gatekeeper to restrict kubernetes to create specific types of resources

从 0 到 1 开展软件测试

鼠标滑动两张图片前后对比js插件

Machine learning library scikit learn (linear model, ridge regression, insert a column of data, extract the required column, vector machine (SVM), clustering)
![Dqn theoretical basis and code implementation [pytoch + cartpole-v0]](/img/cf/32438e403544aa42e2fdd2e181327c.png)
Dqn theoretical basis and code implementation [pytoch + cartpole-v0]

Use RZ, SZ commands to upload and download files through xshell7

通过OpenHarmony兼容性测评,大师兄开发板与丰富教培资源已ready

MySQL addition, deletion, query and modification (basic)

MySQL log management and full backup incremental backup and recovery

ResNet
随机推荐
Net SNMP development I
Number of supported question banks and examination question banks of swiftui examination question bank project (tutorial includes source code)
洛谷每日三题之第四天
Work fishing clock simulator wechat applet source code
[NoSQL] redis high availability and persistence
Oracle closes the recycle bin
Flutter development: running the flutter upgrade command reports an error exception:flutter failed to create a directory at... Solution
本地存储localStorage⽤法详解
Browser cannot open tensorboard
神经网络学习笔记2.2 ——用Matlab写一个简单的卷积神将网络图像分类器
模块(block、module)的介绍
Go语言中的Iota关键字怎么使用
Unity solves the problem of Z-fighting caused by overlapping objects with the same material
10. Redis 面试常见问答
Neural network learning notes 2.2 -- write a simple convolution neural network image classifier with MATLAB
Install Net prompt "cannot establish a certificate chain to trust the root authority" (simple method with download address)
Cmake common commands
Chengxin University envi_ IDL first week experiment test: simple operation of array + detailed analysis
Bisenetv2 face segmentation ncnn reasoning
Win10 onedrive failure reinstallation