当前位置:网站首页>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 ;

边栏推荐
- Matlab|基础知识总结一
- Leetcode linked list question - interview question 02.07. linked list intersection (learn linked list by one question and one article)
- Information fusion method and application of expert opinion and trust in large group emergency decision-making based on complex network
- Pytorch学习记录(四):过拟合、卷积神经网络CNN
- Uniapp progress bar customization
- Why on earth is it not recommended to use select *?
- 针对下一代Chromebook,联发科推出新款芯片组MT8192和MT8195
- 不用Swagger,那我用啥?
- 实现瀑布流效果
- Introduction to wechat applet development, develop your own applet
猜你喜欢

Versailles ceiling: "the monthly salary of two years after graduation is only 35K, which is really unpromising ~ ~"

MATLAB从入门到精通 第1章 MATLAB入门
![Leetcode 19. delete the penultimate node of the linked list [knowledge points: speed pointer, recursion, stack]](/img/86/c74a63c3465efbed74c2bf059bac4f.jpg)
Leetcode 19. delete the penultimate node of the linked list [knowledge points: speed pointer, recursion, stack]

Zhuzhou Jiufang middle school carried out drowning prevention and fire safety education and training activities

八、QOS队列调度与报文丢弃

Leetcode linked list question - interview question 02.07. linked list intersection (learn linked list by one question and one article)

8、 QoS queue scheduling and message discarding

不用Swagger,那我用啥?

Uniapp progress bar customization

LeetCode链表问题——142.环形链表II(一题一文学会链表)
随机推荐
Construction of Chinese traditional embroidery classification model based on xception TD
How to understand data mesh
Nano gold coupled antibody / protein Kit (20nm, 1mg/100 μ g/500 μ G coupling amount) preparation
1162. Map analysis - non recursive method
NTP server time (view server time)
PyQt5快速开发与实战 5.4 网页交互
苹果M1处理器详解:性能及能效成倍提升,Intel酷睿i9也不是对手!
30. Learn highcharts label rotation histogram
Is it necessary to calibrate the fluke dtx-1800 test accuracy?
LT7911D Type-C/DP转mipi 方案成熟可提供技术支持
How is nanoid faster and more secure than UUID implemented? (glory Collection Edition)
不用Swagger,那我用啥?
The general strike of three factories in St France may make the shortage of chips more serious!
Versailles ceiling: "the monthly salary of two years after graduation is only 35K, which is really unpromising ~ ~"
Leetcode 142. circular linked list II [knowledge points: speed pointer, hash table]
Baidu search is in line with expectations, but it involves the black hat strategy of the external chain. What is the reason?
The University was abandoned for three years, the senior taught himself for seven months, and found a 12K job
Object based real-time spatial audio rendering - Dev for dev column
Chinese patent keyword extraction based on LSTM and logistic regression
C process control statement