Matlab knowledge summary-command window clear pinv(M)-e meaning-zeros usage-repmat usage

1. How to clear the command window of matlab

Enter clc in the command window and press enter to clear everything on the command line.

2. How to find the generalized pseudo-inverse in matlab

pinv(M) is the generalized inverse of the matrix M.

3. The meaning of e in MATLAB

The e in matlab has a different meaning. If there is no coefficient in front of e, then the e in the command line is an undefined unknown character. The following example is sufficient. If there is a coefficient in front and a sign and a value in the back, it is the logarithm of the base number with 10 digits.

(1) And exp(1) is the logarithm based on e=2.7183.

(2) If the value after e is positive, the plus sign can be omitted, if it is negative, it cannot be omitted. As shown below:

4 usage of zeros

grammar

B = zeros(n)
B = zeros(m,n)
B = zeros([m n])
B = zeros(d1,d2,d3...)
B = zeros([d1 d2 d3...])
B = zeros(size(A))
zeros(m, n,...,classname)
zeros([m,n,...],classname)

description

(1) B = zeros(n) returns an nxn zero matrix. If n is not a scalar, an error will be thrown.

(2) B = zeros(m,n) or B = zeros([mn]) returns an mxn zero matrix.

(3) B = zeros(d1,d2,d3...) or B = zeros([d1 d2 d3...]) returns a zero of d1-by-d2-by-d3-by-... Array of elements.

(4) B = zeros(size(A)) returns an array of zeros of the same size as A.

(5) zeros(m, n,...,classname) or zeros([m,n,...] returns an mxn x...zero array of type classname. classname can be some of the following values: double' ,'single','int8','uint8','int16','uint16','int32', or'uint32'

5. Usage of repmat function

B = repmat(A, m, n)% Copy matrix A into m*n blocks, that is, B is tiled by m*n blocks A

B = repmat(A, [mn])% is consistent with the above

 

B = repmat(A, [mn p...]) %B is made up of m*n*p*... tiles of A

repmat(A, m, n)% When A is a number a, this command generates an m*n matrix composed of a

 

Guess you like

Origin blog.csdn.net/a1456123a/article/details/105339934