Permanent variables commonly used by Matlab.
Ans: The default variable name of the calculation result.
I j: basic virtual number unit.
EPS: System floating point (f10a9bg OHT ):
INF: infinite, for example, 1/0
Nan NAN: non-numerical value (N airline a nmnb Thank you)
Pi: circumference rate n (n = 1415926 ..).
Realmax: the maximum value that the system can represent.
Realmin: Minimum value that the system can represent,
Nargin: Number of input parameters of the function:
Nargout: the majority of Output Functions
① All operations of Matlab are defined on the complex city. Only the solution in the First quadrant is returned.
7. MATLAB uses the left oblique/and right/to represent the "Left Division and" right division "Operations respectively. For scalar operations, there is no difference between the two: But for matrix operations, the two will produce different results.
Polynomial representation and Operation
P (x) = x ^ 3-3x-5 can be expressed as P = [1 0-3 5]. When x = 5, plotval (p, 5) is used)
You can also obtain the vector: A = [3 4 5], plotval (P,)
Evaluate the root of the polynomial using the function roots (P)
P = [1 0-3 5];
R = roots (P)
Restructured the polynomial poly (Root) from the root)
Q = poly (r)
Real (q) sometimes produces a virtual root, and you can use real to extract the real root.
Conv (a, B) function polynomial multiplication (perform convolution of two arrays)
A = [1 2 3 4];
B = [1 4 9 16];
C = Conv (A, B)
The addition and subtraction of polynomials. The lower degree polynomials must be filled with the first zero, so that they have the same order as the higher degree polynomials.
Polynomial Division [Q, R] = deconv (C, B) indicates that B/c Q is the quotient polynomial, and r is the remainder.
Derivative polyder (F) of Polynomial)
F = [2 4 5 6 2 1];
S = polyder (f)
Polynomial curve fitting
X = [1 2 3 4 5];
Y = [5.6 40 150 250 498.9];
P = polyfit (X, Y, n) Data n times polynomial fitting poly: matrix feature polynomials, the polynomials corresponding to the root SET
X2 =.; when n is 1, it is the least square method.
Y2 = polyval (p, X2); Calculate the polynomial value (polyvalm calculates the Matrix polynomial)
Plot (X, Y, '*', X2, Y2); grid on
Least Squares
X = [1 2 3 4 5];
Y = [5.6 40 150 250 498.9];
Plot (X, Y, '*'), lsline
Polynomial Interpolation (p158)
Yi = interp1 (X, Y, XI, 'method') one-dimensional Interpolation
(Xi is the independent variable coordinate vector of the interpolation point. It can be an array or a single number.
Method is the method for selecting interpolation algorithms, including:
Linear (linear interpolation)
Cubic (cubic Interpolation)
Spline (cubic spline interpolation)
Nearst (near interpolation)
Example: population prediction
Year = 1900: 10: 1900;
Number = [78 91 105 .... Population per ten years];
X = 1900: 1: 2000;
Y = interp1 (year, number, X, 'spline ');
Plot (year, numeber, '*', x, y); grid on
One-dimensional Boli leaf transform interpolation is implemented using the interpft function to calculate the Fourier transformation of Vectors Containing cyclic function values.
Then, use more points for Inverse Fourier transformation. The format of the function is as follows: Y = interpft (x, n) where X is the vector containing the cyclic function value, and is an offset point, and N is the number of equal spacing points.
Returns the minimum value of a single-dimensional function.
Y = fminbnd ('humps ', 0.3, 1) humps is a built-in Function
Returns the minimum value of a multivariate function.
The fminserch function is used to calculate the minimum value of a multivariate function. It can specify a starting vector instead of a specified interval. This function returns a vector corresponding to the local minimum function value of this multivariate function.
Texture ing
The texture ing function of warp function is used to display a plane image on a spatial 3D surface.
Project the image named flowers. tif to the cylindrical and star surfaces, respectively.
I = imread ('Flowers. tif ');
[X, y, z] = cylinder;
Subplot (1, 2), warp (X, Y, Z, I );
[X, y, z] = sphere (50 );
Subplot (1, 2), warp (X, Y, Z, I );
Warp (X, Y, Z, I );
Evaluate the zero point of the Function
Evaluate the zero point fzero ('humps ', [1, 2]) of the humps function in the range [1];
You can also give an initial value fzero ('humps ', 0.9 );
For polynomials, you can directly query the root of the polynomials ('4 * x ^ 3 + ...... ');
You can also use solve
C = Sym ('C', 'real ');
X = Sym ('x', 'real ');
S = solve (x ^ 3-x + C)
Function credits
Q = quadl ('humps',). You can use the quad statement to calculate the credits of the humps function in the range of 0 and 1.
The dual integral first calculates the inner integral, and then uses the intermediate result of the inner integral to obtain the value of the dual integral, similar to the step-by-step Integral Method in the integral.
Result = dblquad ('integrnd', Xin, xmax., ymin, Ymax) integrnd is the name string of the product function.
Symbol integral operation int (f)
The most accurate is the symbolic integration method.
Calculate S = listen 12 [000001 xydx] dy
Syms x y contains spaces and cannot contain commas.
S = int (INT ('x ^ y', 'x',), 'y',) quotation marks can be omitted
VPA (s) displays the value of S
The inner point is limited to the double points of the function.
I = listen 14 [√ Y2 (X2 + y2) dx] dy
Symbol method I = VPA (INT ('x ^ 2 + y ^ 2', 'x', SQRT (Y), 2), 'y)
Diff)
Differentiation describes the slope of a function at a point and is the microscopic nature of the function. Therefore, points are not sensitive to changes in the function shape within a small range, while differentiation is very sensitive. -Small changes of functions are prone to large changes in the slope of adjacent points. Due to the inherent difficulty of dry differentiation, avoid numerical differentiation as much as possible, especially the data obtained from experiments. In this case, it is best to use the least square curve to fit the data, and then perform the differential operation on the obtained polynomial. Or, use another method to perform cubic spline fitting on the point data, then look for Spline differentiation, but sometimes the differential operation is unavoidable, in MATLAB. calculate the difference of a vector or matrix using the function diff juice (which can also be understood as a difference ).
A = [1 2 3 3 3 7 8 9];
B = diff (a) One-time differentiation
BB = diff (A, 2) quadratic differentiation
Actually diff (A) = [A (2)-A (1), a (3)-A (2 ),......, A (n)-A (n-1)]
For the matrix differentiation, that is, to find the vector differentiation of each column, from the vector micro-score can judge the monotonicity of the vector, whether the spacing and whether there are repeated elements.
Diff)
Syms x T
F = cos (A * X)
DF = diff (f) is defined by the findsym rule and is implicitly specified to differentiate X.
DFA = diff (F, 'A') specifies the differentiation of variable
DFA = diff (F, 'A', 3) triplicate
The diff function not only applies to the scalar, but also to the matrix. The calculation rule is to perform the differential operation based on the elements of the matrix.
Syms a x
A = [cos (A * X), sin (A * X),-sin (A * X), cos (A * X)];
DA = diff ()
Differential Equation dsolve
In Matlab, the symbol expression contains the letter D to represent the differential operation. D2 and D3 correspond to the second and third derivatives respectively. d2y indicates d2y/dt2 defaults T.
Y = dsolve ('dy = f (y) ') single equation, Single Output
[U, V] = dsolve ('du = f (u, v) ', 'DV = g (u, v)') two equations and two outputs
S = dsolve ('dx = f (x, y, z) ', 'dy = g (x, y, z)', 'dz = k (x, y, y, z )')
Three equations S. x s. y s. Z, architecture Array
Dsolve ('dx =-A * x') Result: C1 * exp (-A * t) does not specify an initial value, so the result contains a variable.
X = dsolve ('dx =-A * x', 'x (0) = 1', 's') The result exp (-A * S) gives the initial value, set the independent variable to S.
Calculate the gradient of a multivariate Function
FX = gradient (f) F is a vector that returns the one-dimensional numerical gradient of F. FX corresponds to the differential in the X direction.
[X, y] = meshgrid (-2:. 2,-2:. 2 );
Z = x. * exp (-X. ^ 2-y. ^ 2 );
[PX, Py] = gradient (z,. 2,. 2 );
Contour (z), hold on draw contour
Quiver (PX, Py)
MATLAB string operation
Use the sym command to create an expression
F = Sym ('cos (x) + sin (x) ') or Syms X, F = cos (x) + sin (X)
Diff (f) for its Derivative
(You can also directly use the command F = diff ('cos (x) + cos (y )')
When a character expression contains more than one variable, only-variables are independent variables. If you do not tell MATLAB which variable is an independent variable, you can run the findsym command to ask
Use the findsym command to query Independent Variables
F = Sym ('sin (A * x) + B ')
Findsym (F, 1) provides independent variables (one variable, two variables if it is 2)
Findsym (f) gives all the variables
Simplification and replacement of symbol expressions
Collect function collect (F, v) indicates that F is expressed as a polynomial form of the symbol variable V, that is, V merges the same class items. V defaults to the default variables determined by findsym.
Syms X Y
F = x ^ 2 * Y + y * X-x ^ 2-2 * x + 1
Collect (f) Get (-1 + y) * x ^ 2 + (y-2) * x + 1
Collect (F, Y) to obtain (x + x ^ 2) * Y + ^ 2-2 * x
The expand function expand (f) expands, writes, and forms F.
Syms x
Expand (x-1) ^ 3) Get x ^ 3-3 * x ^ 2 + 3 * X-1
Horner function HORNER (f) writes F as an embedded set.
Syms x
Horner (x ^ 3-6 * x ^ 2) returns (-6 + x) * x ^ 2
The Factor Function factor (f) converts F to the product of the low-order rational polynomial.
Syms x
F = x ^ 3-6 * x ^ 2 + 11 * x-6
Factor (f) Get (x-1) * (X-2) * (X-3)
Simplification of simplify (f) Functions
Simplest form of simple (f) Functions
Syms x
F = 2 * sin (x ^ 2) + cos (3 * X)
Simple (f) If you do not want to see the intermediate process, you can use the z = simple (f) command twice to obtain the simplest form.
If you want to know which simplified command to get the final result, you can add a parameter "how ".
[Z, how] = simple (f)
Symbol Expression replacement
Subs (F, new, old)
F = 'a * x ^ 2 + B * x + C'
Subs (F, 't', 'x') returns a * (t) ^ 2 + B * (t) + C subs, which is a symbolic function and returns a symbolic variable.
The subexpr function is sometimes difficult to understand the symbolic expression returned by MATLAB. Using the subexpr function, you can use a symbol to represent the repeated subexpressions in the expression, thus simplifying the expression form.
C = Sym ('C', 'real ');
X = Sym ('x', 'real ');
S = solve (x ^ 3-x + C)
A = subexpr (s) Get Sigma =-108 * C + 12*(-12 + 81 * C ^ 2) ^ (1/2)
A =
[1/6 * Sigma ^ (1/3) + 2/SIGMA ^ (1/3)]
[-1/12 * Sigma ^ (1/3)-1/SIGMA ^ (1/3) + 1/2 * I * 3 ^ (1/2) * (1/6 * Sigma ^ (1/3) -2/SIGMA ^ (1/3)]
[-1/12 * Sigma ^ (1/3)-1/SIGMA ^ (1/3)-1/2 * I * 3 ^ (1/2) * (1/6 * Sigma ^ (1/3) -2/SIGMA ^ (1/3)]
The pretty function sometimes works the same way.
Pretty (f) shows the regular writing form of a function
Solving Linear Equations
To solve the linear equations, use the backslash/
A = hilb (3)
B = [1 2 3]'
A/B
Matrix feature value and feature vector
Use the EIG (v, d) function, [V, d] = EIG (a); where D returns the feature value, and V returns the corresponding feature vector, by default, the second parameter returns only the feature value.
Syms a B C real
A = [a B c; B c a; c a B];
[V, d] = EIG ();
To make it clearer, use the previously learned replacement function, instead of using the default Sigma, instead of using M, explicitly replacing the tedious expression Sub-expression.
VV = subexpr (v );
Vs = Subs (VV, 'M', 'sigma ') running result:
Vs =
[1, 1, 1]
[-(C + (M)-A)/(c-B),-(C-(m)-A)/(c-B), 1]
[-(A-(m)-B)/(c-B),-(A + (M)-B)/(c-B), 1]
Replace the expression child in D with m
Dd = subexpr (d );
DS = Subs (DD, 'M', 'sigma ')
Running result: DS =
[(M), 0, 0]
[0,-(M), 0]
[0, 0, C + A + B]
Note: You can use the following command to calculate the feature value:
F = poly (A) poly function is used to calculate the feature polynomial of.
D = solve (f) function is used to calculate the polynomial solution.
SVD () function is used to calculate the Singular Value Decomposition of a matrix. The matrix is divided into two orthogonal matrices and the product of the diagonal matrix.
A = Sym (hilb (2 ))
[U, S, V] = SVD ()
Algebraic Equations and equations
The solve (f) command can be used to solve the algebraic equation. If F does not contain =, Matlab sets the expression to zero. The unknown number of the equation is determined by findsym by default or explicitly indicated by findsym.
Syms a B C x
Solve (A * x ^ 2 + B * x + C) uses X as the default variable
Solve (A * x ^ 2 + B * x + C, A) specifies that A is a variable
Evaluate the solution of an equation containing equal signs (must be enclosed in single quotes)
F = solve ('cos (x) = sin (x )')
X = solve ('exp (x) = tan (x) ') if the Symbolic solution cannot be obtained, the variable-precision solution is calculated.
Solving equations is similar to solving single equations.
Returns a three-element equation.
V = solve ('a * u ^ 2 + V ^ 2', 'U-V = 1', 'a ^ 2-5 * A + 6 ')
The result is V =
A: [4x1 sym] U: [4x1 sym] V: [4x1 sym]
Some common symbol operations
Limit operation limit
Limit (f) calculates the limit from X to 0.
Limit (f, x, A) or limit (F, a) calculates the limit between x and.
Limit (F, A, 'left') limit (F, A, 'right') calculates the left limit and right limit of X to.
Limit (F, INF) calculates the limit that X tends to be infinite.
Symsum (s)
Symsum (s) sums the variables determined by the default findsym.
Symsum (S, v) sums the values of the variable V specified in S.
The finite sum of symsum (s, a, B) symsum (S, V, A, B) from A to B
Syms k N
Symsum (k) sums from 0 to K
Symsum (K, 0, n-1) sums from 0 to n-1
Symsum (1/K ^ 2, 1, INF) infinite Sum
Taylor series Taylor (f)
Taylor (f) is used to evaluate the 5-level talor expansion of F. You can add the specified expanded order of the parameter (default value: 5), or specify the expanded variable for the multivariate function, you can also specify at which point to expand
Syms x T
Taylor (exp (-x ))
Taylor (log (x), 6, 1) expands at the 6th order of Taylor at 1 point
Taylor (x ^ t, 3, T) expands the Level 3 Taylor of T
Point conversion
Fourier transformation and inverse transformation Fourier (f)
Fourier analysis can convert signals into sine curves of different frequencies. It can analyze discrete data or analyze continuous time systems, especially in the field of signal and graphics processing. Discrete transform (DFT) is used to collect finite data. The most effective method is Fast Fourier Transform (FFT)
F = Fourier (f) independent variable X, returns the function about parameter W.
F = Fourier (F, v) returns the function f about the symbol object v.
F = Fourier (F, u, v) transforms the f function about U, instead of the default W. The returned function f is a function about v.
Syms T v w x
Fourier (1/T)
Fourier (exp (-t) * Sym ('heaviside (t) '), V)
Fourier (diff (Sym ('f (x) '), X, W)
Fourier inverse transformation
F = ifourier (f) default independent variable W, returns the function about X for W Integral
F = ifourier (F, v) returns the function F, which is a function about symbol object v, rather than the default X
F = ifourier (F, u, v) is about u function F transformation, rather than the default X, return function f is about V function
Laplace transformation and inverse transformation Laplace (f)
It can be used in a continuous system (differential equation) to solve the initial value problem of a differential equation.
Laplace (f) defaults to independent variable t, and returns the function L about S by default.
Laplace (F, T) returns the function L about T, instead of the default s
Laplace (F, W, z) is the independent variable W points of function f, and returns the function L about Function Z.
Inverse Transformation
F = ilaplace (l) default independent variable S, returns the function f about t
F = ilaplace (L, Y) returns the function f about y, instead of the default t
F = ilaplace (L, Y, x) returns the f function of X to the independent variable Y integral of function L.
Z-transform and inverse transformation Z-transform of ztrans (f) scalar symbol F
F = ztrans (f) default Independent Variable N, returns the function about Z
F = ztrans (F, W) returns the function f about the symbol variable W, instead of the default Z
F = ztrans (F, K, W) symbol variable about K for Z-transformation return function about symbol variable W
Inverse Transformation iztrans (f)
F = iztrans (f) or (F, k) or (F, W, K)
Symbol plotting function
Symbol function simple plot function ezplot (f)
F can contain a string or expression of a single symbol variable X. The default drawing interval (-2PI, 2PI). If f contains x and y, the image drawn is f (x, y) the default range is-2PI. Ezplot (F, xmin, xmax) or ezplot (F, [xmin, xmax]) is drawn in xmin Syms x T
Ezplot ('t * Cos (t)','t * sin (t)', [* Pi])
Sign Image Rendering function Fplot (fun, LIMS, Tol, 'espec ', n)
Here, LIMS = [xmin, xmax] or [xmin, xmax, ymin, Ymax] tol indicates the specified relative error, by default, 0.001 'espec 'specifies the line type of the plot. N specifies a drawing with at least N + 1 points.
[X, y] = Fplot (fun, LIMS ,...) Only the points used for drawing are returned. You can call plot (x, y) to draw the drawing by yourself.
Syms x
Subplot (, 1), Fplot ('humps', [])
F = 'abs (exp (x * (0: 9) * ones (10, 1 ))'
Subplot (, 2), Fplot (F, [* Pi])
Subplot (0.01, 3), Fplot ('sin (1./x) ', [0.1,], 1e-3)
MATLAB plot
2D drawing
Plot draws two-dimensional images in the (x, y) coordinates and supports multiple x-y binary structures.
Plot3 plot 3D images in the (x, y, z) coordinates
Loglog draws two-dimensional images under the (x, y) logarithm coordinate
Semilogx plot in two-dimensional coordinates where X is the logarithm coordinate and Y is the linear Coordinate
Semilogy plot in two-dimensional coordinates where X is a linear coordinate and Y is a logarithm coordinate
Plotyy plot with two Y axes
Plot usage
Plot (X, Y, '-- Rs', 'linewidth', 2, 'markeredgecolor', 'k ',...
'Markerfacecolor', 'G', 'markersize', 10)
Plotyy usage
Plotyy (x1, Y1, X2, Y2) is based on X1, the Left axis is the Y axis, the Y1 vector is drawn, X2 is the reference, the right axis is the Y axis, and the Y2 vector is drawn.
Plotyy (x1, Y1, X2, Y2, fun) plot functions (plot, semilogx, semilogy, loglog, stem) specified by string fun)
Plotyy (x1, Y1, X2, Y2, fun1, fun2)
T = 0: PI/20:2 * PI;
Y = exp (sin (t ));
Plotyy (T, Y, T, Y, 'plot', 'stem ') stem is a two-dimensional pole chart.
[Ax, H1, H2] = plotyy (...) Returns the handles of the left and right Y axes (ax (1) ax (2), and the graphics objects generated in the two axes, H1 H2, respectively.
T = 0: 900;
A = 1000;
A = 0.005;
B = 0.005;
Z2 = cos (B * t );
Z1 = A * exp (-A * t );
[Haxes, hline1, hline2] = plotyy (T, Z1, T, Z2, 'samples', 'plot ');
Axes (haxes (1 ))
Ylabel ('semilog plot') logarithm coordinate
Axes (haxes (2 ))
Ylabel ('linear plot ')
Set (hline2, 'linestyle ','--')
Other 2D drawing commands
Bar (x, y) two-dimensional bar chart
Hist (Y, n) histogram
Histfit (Y, n) has a histogram of quasi and line. n is the number of vertices.
Stem (x, y) Fireworks
Comet (x, y) Trajectory Map
Compass (x, y) Compass chart
Errorbar (X, Y, L, u) Error Limit Diagram
Feather (x, y) feather chart
The fill (X, Y, 'R') two-dimensional filling function is filled in red.
Pie (x) pie chart
Polar (T, R) Polar chart r is the amplitude vector, and T is the angle vector.
T =. * PI;
R = cos (3 * T/2) + 1/2;
Polar (T, R), xlabel ('polar directive ')
Quiver (x, y) magnetic line chart
Stairs (x, y) Step chart
Number of loglog (x, y) pairs
Semilogx semilogy semi-logarithm Graph
MATLAB 3D plot
Plot3 (x, y, z) three-dimensional line chart
T = 0: PI/50: 15 * PI;
Plot3 (sin (t), cos (t), T, 'r * ') is similar to plot
V = Axis returns the range of each axis.
Text (, 0, 'origin') adds text to a coordinate point
To increase the dimension of plot3, you can draw multiple images at a time to arrange the two-dimensional images in one axis.
Draw a three-digit line chart
Mesh (x, y, z)
Mesh (X, Y, Z, c) four-dimensional plotting, (x, y, z) representing three-dimensional space, c Representing the color dimension
Mesh (..., 'Property name', property value ,...) Set the attribute values of the curved surface.
[X, y, z] = sphere (12 );
Mesh (x, y, z) and hidden off surfaces are set to transparent
Meshc (x, y, z) draws a grid chart and a basic isoplot
Meshz (x, y, z) draws a zero-plane grid chart
Waterfall (x, y, z) is the same as mesh, but its gridlines only appear in one direction of the X axis, and are watermarked.
Two variable scalar commands meshgrid (x) or meshgrid (x, y) (p179)
Two one-dimensional vectors are generated to perform the z = f (x, y) operation. All values of Z are calculated. Z is a scalar command of x y.
[X, y] = meshgrid (x) meshgrid (x, x)
[X, y] = meshgrid (x, y)
[X, y, z] = meshgrid (x, y, z) for 3D drawing
[X, y] = meshgrid ([-.]);
Z = x. * exp (-X. ^ 2-y. ^ 2 );
Plot3 (x, y, z)
Surf (X, Y, Z, c) colored surface map
Surf (x, y, z) implies c = z
Surf (z) implies X. The value of Y is automatically generated by the surf command according to Z size.
Surfc plot a curved surface with a basic contour
Surfl plot a curved area with brightness
The entire line segment of the shading flat network cable graph or a patch of the curved surface graph is colored.
The color of each point in a shading interp line or patch is obtained by linear interpolation of the top color of the line or slice.
A curved surface map cannot be as transparent as a grid chart, but data can be set to nun at a hole when necessary.
Draw contour lines
Draw a contour line Contour in a two-dimensional space
Contour (X, Y, Z, n) draw n contour lines (N can be omitted)
Contour (X, Y, Z, v) draws a contour line on the height specified by vector V (SAVE)
C = contour (x, y, z) calculates the height of the contour.
C = contourc (X, Y, Z, n) calculates the x-y coordinate data of N contour lines.
C = contourc (X, Y, Z, v) calculates the x-y coordinate data of the contour lines specified by vector v.
Clabel (c) adds a height mark to the contour lines represented by array C.
Clabel (C, V) marks the height of the contour line specified by vector v.
Clabel (C, 'manual') uses the mouse to add a height mark to the contour lines in the vertex
3D space plot contour line 3 (x, y, z)
[X, y, z] = peaks (30 );
Limit 3 (x, y, z, 16, 'G ')
Pseudo color map pcolor (x, y, z) of binary Functions)
It is a two-dimensional equivalent command for instruction surf, which represents pseudocolor. It can be used with the contour monochrome contour to draw a color isogram.
[X, y, z] = peaks (30 );
Pcolor (x, y, z); pseudo color
Shading interp color interpolation to make the color mean gradient
Hold on, contour (X, Y, Z, 20, 'k')... draw the contour
Colorbar ('horiz ') Horizontal color ruler
C = contour (X, Y, Z, 8 );
Clabel (c) label contour lines
Vector Field map (velocity chart) quiver
Used to describe the gradient size and direction of the function z = f (x, y) at the point (x, y)
[X, y] = meshgrid (x, y) X, and Y are coordinate matrices of Z elements.
[U, V] = gradient (z, dx, Dy) U, V is the derivative of Z to X to Y, and DX dy is the computing step in the x y direction.
Quiver (X, Y, U, V, S, 'espec ', 'filened') U and V are required to determine the size and direction of each vector in a vector field, S is the size of the specified arrow, 1 is missing, linespec is the string, and legal line and color are specified, filled is used to fill the defined drawing identifier
[X, y] = meshgrid (-2:.,-1:. 15 );
Z = x. * exp (-y. ^ 2 );
[PX, Py] = gradient (z,. 2,. 15 );
Contour (x, y, z );
Hold on, quiver (X, Y, PX, Py), axis Image
Fill the polygon in fill (X, Y, c)
C defines the color string, which can be 'R' or 'B', or use RGB to indicate that the value of [R, G, B] is 0-1.
Four-Dimensional representation of images
Link