In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
The editor will share with you an example analysis of the basic operation of Matlab. I hope you will get something after reading this article. Let's discuss it together.
Matlab basic operation array:
The multiplication and division of the array are represented by ". *" and ". /", respectively. The relationship between right division and left division is: A./B=B.\ A, where An is the divisor and B is the divisor.
Size () and length () detect the size of the array: size () gets the number of rows and columns of the array, and length () gets the length of the one-dimensional array. If it is a two-dimensional array, it returns the larger of the rows and columns.
Ndims () calculates the dimensions of the array. A single scalar returns 2, which can be seen as an array of rows and columns.
Whos to get the size of the array and how much memory it takes
The search for array elements uses the function find (), which returns the subscript of the element whose relational expression is true.
The sort function sort (), which defaults to ascending order: sort (A ~ #); descending order
Matrices: matrices in matlab are stored by column. 1. Extension of matrix
Cat (DIM,A,B): this function joins matrix An and B on the DIM dimension, and the return value is the connected matrix
Vertcat (A _ Magi B): this function joins arrays An and B horizontally, which is equivalent to cat.
Horzcat (A _ Magi B): this function joins arrays An and B vertically, which is equivalent to cat (2 ~ ~ A _ Magi B)
two。 Block operation
B=repmat: this function produces a large matrix B, which treats matrix An as a single element and produces a large matrix B consisting of matrix A with m rows and n columns.
B=repmat (A _ Magi m): this function produces a large matrix B, which treats matrix An as a single element, and produces a large matrix B consisting of matrix A with m rows and m columns.
Y=blkdig (An and B): this function uses matrices An and B as diagonal blocks to generate a new matrix Y
3. Transpose
If it is a plural, it will be converted to a conjugate plural
The real transpose of the matrix is A.' Or you can use the function transpose (A)
4. Rotate and flip
The rotation of the matrix can be transposed or the function rot90 () can be used.
Rot90 (A): rotate the function matrix 90 °counterclockwise
Rot90 (A _ quotient k): rotate the function matrix 90 °by k times counterclockwise. The default value is 1.
Flip the matrix left and right fliplr (A)
Flip the matrix up and down flipud (A)
5. Change the size of the matrix
Y=reshape (Xperim _ m _ n)
6. Decomposition of matrix
Cholesky decomposition: for positive definite matrix, it can be decomposed into the product of upper triangular matrix and lower triangular matrix. When using chol () function to decompose, it is best to get all the eigenvalues of the matrix through the function eig (), and check whether the eigenvalues are positive.
LU decomposition: also known as Gaussian elimination, the simulation is decomposed into the product of the permutation matrix L of the lower triangular matrix and the upper triangular matrix U
QR decomposition: that is, orthogonal decomposition
After reading this article, I believe you have some understanding of "sample Analysis of Matlab basic Operations". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.