当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
Rescue system -- the application of read-write separation
等保备案是什么意思?应该去哪里办理备案?
第七章 操作位和位串(三)
RuntimeError: Missing dependencies:XXX
微博撰写-流程图-序列图-甘特图-mermaid流程图-效果不错
2020中国全国各省市,三级联动数据,数据机构(数据来自国家统计局官网)
疫情、失业,2022,我们高喊着摆烂和躺平!
leetcode 1268. Search suggestions system
liunx服务器 telnet 带用户名 端口登陆方法
教程篇(5.0) 08. Fortinet安全架构集成与FortiXDR * FortiEDR * Fortinet 网络安全专家 NSE 5
Qt源码分析--QObject(2)
A tip to read on Medium for free
数据库迁移从PostgreSQL迁移到 MYSQL
Using ngrok for intranet penetration
Qt 中发送自定义事件
Liunx Mysql安装
String转Base64
数据中台:国内大厂中台建设架构集锦
Get screen width and height tool class
Shell basic operator -- arithmetic operator




![打印出来的对象是[object object],解决方法](/img/fc/9199e26b827a1c6304fcd250f2301e.png)




