当前位置:网站首页>Matlab | basic knowledge summary I
Matlab | basic knowledge summary I
2022-07-28 21:52:00 【Frost Creek】
Matlab Basics
Matlab The general form of a statement :
Variable = expression | Evaluate the value of an expression , And assign the result to the assignment number “=” The variable on the left |
Matlab Execution of command : enter
Matlab All commands and built-in functions are composed of lowercase letters
Matlab Naming rules for variables :
Start with a letter ;
By letter 、 Numbers and underscores ;
Letters are case sensitive ;
Don't be too long , Generally, do not exceed 63 Characters
Common function keys

System predefined variables

Special variables :ans
Matlab The number in :
① The default is double precision real numbers ;
② It can be expressed in floating-point form or scientific counting ;
③ The range of real numbers that can be represented is :10-308 ~ 10308;
④ The relative error of floating-point operation is eps, about 2.2 10- 16;
⑤ Plural input :z=3+4i, Pay attention to the imaginary part and i There must be no space between them
Basic operation and priority


Special symbols

Command separator : Comma or semicolon
If you don't want to display the results on the screen , Semicolon can be used as statement terminator
System operation command

Workspace and search path management

Matlab All punctuation marks in must be entered in English !
Matrix operations
Matlab: Matrix lab , Take matrix as basic operation unit , stay Matlab in , Everything is a matrix matrix
Direct input : Such as A=[1 2 3; 4,5,6]
① In square brackets “[ ] ”;
② The elements in the same line are separated by spaces or commas ;
③ Lines are separated by semicolons
The special function of colon :a:b:c % Generate a vector that satisfies the arithmetic sequence
① a It's the first ,b It's tolerance , c Determine the last item ( Not necessarily the last item );
② If the tolerance is 1, It can be abbreviated as a:c
References to matrix elements


Delete the specified row or column

Common matrix generating functions

Basic matrix operations
① Addition and subtraction :A+B,A ‐B, Operate on the components
② Ordinary multiplication :A*B
③ division :A\B Equivalent to A‐1B,A/B Equivalent to AB‐1
④ Power operation :A^p, namely p individual A Multiply , A It's the square , p It's a positive integer.
⑤ The transpose of the matrix :A'( Conjugate transpose ),A.'( Normal transpose , Do not take conjugation )
Array operation of matrix : Operate on the corresponding elements , Including dot multiplication ( .*), Point division ( ./ .\), Point power ( .^)
① There cannot be spaces between points and arithmetic operators
② The objects participating in the operation must have the same shape
Matrix Kronecker The product of :kron(A,B)
The flip and rotation of matrix

Change the shape of the matrix and check the size of the matrix

The value of the function acting on the matrix : set up f Is the function ,x It's a variable. ( It can be a vector or a matrix )
①f(x) It's about x On each component of ;
② if x It's a matrix , be f(x) It's a relationship with x Matrices of the same shape
Matrix and number operation
① Addition and subtraction : Every element of the matrix adds and subtracts with numbers ;
② Matrix times a number : Every element of the matrix is multiplied by numbers ;
③ Matrix divided by a number : Each element is divided by this number ;
④ Number and matrix point power operation : Use array operation , Such as 2.^[1,2,3;4,5,6]
Output format of variable :format
① When outputting the calculation result on the screen , Can pass format Command specifies the output format ;
② format Only change the output format , Does not change the value of the variable ;

边栏推荐
- 怎样巧用断言+异常处理类,使代码更简洁!(荣耀典藏版)
- 【Bluetooth蓝牙开发】八、BLE协议之传输层
- World Hepatitis Day | grassroots can also enjoy the three a resources. How can the smart medical system solve the "difficulty of seeing a doctor"?
- C语言入门【详细】
- 微信小程序开发入门,自己开发小程序
- 传微软已获得向华为供货许可!华为将迎来全面解禁?
- OA项目之会议通知(查询&是否参会&反馈详情)
- 小霸王被申请破产!公司成“老赖” ,法人被限制高消费
- Huawei releases the first electric drive system driveone: charging for 10 minutes, endurance of 200km
- Query Oracle view creation statement and how to insert data into the view [easy to understand]
猜你喜欢

Introduction to wechat applet development, develop your own applet

Talk about row storage and column storage of database

物联网技术栈之网关技术

High salary in the workplace | "intermediate and advanced test" interview questions
![[英雄星球七月集训LeetCode解题日报] 第28日 动态规划](/img/79/bc763bb6f12c525454abda18be4265.png)
[英雄星球七月集训LeetCode解题日报] 第28日 动态规划

OA项目之会议通知(查询&是否参会&反馈详情)

大学荒废三年,大四自学7个月测试,找到了12K的工作

微信小程序开发公司你懂得选择吗?

Log slimming operation: how to optimize from 5g to 1g! (glory Collection Edition)

RHCSA第一天
随机推荐
High salary in the workplace | "intermediate and advanced test" interview questions
瑞典法院取消对华为和中兴的5G频谱拍卖禁令
Pytorch学习记录(四):过拟合、卷积神经网络CNN
SkiaSharp 之 WPF 自绘 拖曳小球(案例版)
高举5G和AI两面旗帜:紫光展锐市场峰会火爆申城
详解visual studio 2015在局域网中远程调试程序
How is nanoid faster and more secure than UUID implemented? (glory Collection Edition)
C#流程控制语句
如何优雅的设计工作流引擎(荣耀典藏版)
中国农业工程学会农业水土工程专业委员会-第十二届-笔记
MSI Bao'an factory is on fire! Official response: no one was injured, and the production line will not be affected!
Library borrowing system "suggested collection"
Adventures of little mouse: behind the scenes gags of moss 2
微星宝安工厂失火!官方回应:无人员受伤,产线不受影响!
【Bluetooth蓝牙开发】八、BLE协议之传输层
Week 6 Linear Models for Classification (Part B)
纳米金偶联抗体/蛋白试剂盒(20nm,1mg/100μg/500 μg偶联量)的制备
标准C语言学习总结10
Construction of Chinese traditional embroidery classification model based on xception TD
针对下一代Chromebook,联发科推出新款芯片组MT8192和MT8195