当前位置:网站首页>Solving linear equations with MATLAB ax=b
Solving linear equations with MATLAB ax=b
2022-06-24 08:48:00 【Master Ma】
Law 1: Left division
>> A=[3 1 -1;1 2 4;-1 4 5];B=[3.6;2.1;-1.4];
>> x=A\B
Output :
x =
1.4818
-0.4606
0.3848
Law 2: Inverse method
>> A=[3 1 -1;1 2 4;-1 4 5];b=[3.6;2.1;-1.4];
>> x=inv(A)*b
x2 =
1.4818
-0.4606
0.3848
Law 3: use linsolve Function solving
>> A=[3 1 -1;1 2 4;-1 4 5];b=[3.6;2.1;-1.4];
>> x=linsolve(A,b)
x3 =
1.4818
-0.4606
0.3848
Law 4: use solve Function solving
>> [x1 x2 x3]=solve('3*x1+x2-x3=3.6','x1+2*x2+4*x3=2.1','-x1+4*x2+5*x3=-1.4')
x1 =
1.4818181818181818181818181818182
x2 =
-0.46060606060606060606060606060606
x3 =
0.38484848484848484848484848484848
Law 5: Generalized inverse solution
>> A=[3 1 -1;1 2 4;-1 4 5];b=[3.6;2.1;-1.4];
>> x=pinv(A,b)
x4 =
1.4818
-0.4606
0.3848
边栏推荐
猜你喜欢
随机推荐
Vscode install the remote -wsl plug-in to connect to the local WSL
K8S部署高可用postgresql集群 —— 筑梦之路
分布式 | 如何与 DBLE 进行“秘密通话”
快慢指针系列
定时备份数据库脚本
OpenCV每日函数 结构分析和形状描述符(7) 寻找多边形(轮廓)/旋转矩形交集
Telnet port login method with user name for liunx server
pymysql 向MySQL 插入数据无故报错
MySQL | 视图《康师傅MySQL从入门到高级》笔记
K8s deployment of highly available PostgreSQL Cluster -- the road to building a dream
Scheduled database backup script
[team management] 25 tips for testing team performance management
RuntimeError: Missing dependencies:XXX
【NOI模拟赛】摆(线性代数,杜教筛)
Centos7安装jdk8以及mysql5.7以及Navicat连接虚拟机mysql的出错以及解决方法(附mysql下载出错解决办法)
2138. 将字符串拆分为若干长度为 k 的组
2021-05-20computed和watch应用与区别
Prompt code when MySQL inserts Chinese data due to character set problems: 1366
Easynvr and easyrtc platforms use go language to manage projects. Summary of the use of govendor and gomod
À propos de ETL il suffit de lire cet article, trois minutes pour vous faire comprendre ce qu'est ETL









