Sei sulla pagina 1di 12

>> CONV Convolution and polynomial multiplication. C = CONV(A, B) convolves vectors A and B. The resulting vector is length MAX([LENGTH(A)+LENGTH(B)-1,LENGTH(A),LENGTH(B)]).

If A and B are vectors of polynomial coefficients, convolving them is equivalent to multiplying the two polynomials.

C = CONV(A, B, SHAPE) returns a subsection of the convolution with size specified by SHAPE: 'full' - (default) returns the full convolution, 'same' - returns the central part of the convolution that is the same size as A. 'valid' - returns only those parts of the convolution that are computed without the zero-padded edges. LENGTH(C)is MAX(LENGTH(A)-MAX(0,LENGTH(B)-1),0). ---------------------------------------------------------------------------------------------------------------->> >> help butter BUTTER Butterworth digital and analog filter design. [B,A] = BUTTER(N,Wn) designs an Nth order lowpass digital Butterworth filter and returns the filter coefficients in length N+1 vectors B (numerator) and A (denominator). The coefficients are listed in descending powers of z. The cutoff frequency Wn must be 0.0 < Wn < 1.0, with 1.0 corresponding to half the sample rate.

If Wn is a two-element vector, Wn = [W1 W2], BUTTER returns an

order 2N bandpass filter with passband W1 < W < W2. [B,A] = BUTTER(N,Wn,'high') designs a highpass filter. [B,A] = BUTTER(N,Wn,'low') designs a lowpass filter. [B,A] = BUTTER(N,Wn,'stop') is a bandstop filter if Wn = [W1 W2].

When used with three left-hand arguments, as in [Z,P,K] = BUTTER(...), the zeros and poles are returned in length N column vectors Z and P, and the gain in scalar K.

When used with four left-hand arguments, as in [A,B,C,D] = BUTTER(...), state-space matrices are returned.

BUTTER(N,Wn,'s'), BUTTER(N,Wn,'high','s') and BUTTER(N,Wn,'stop','s') design analog Butterworth filters. In this case, Wn is in [rad/s] and it can be greater than 1.0. -----------------------------------------------------------------------------------------------------------------

>> help filter FILTER One-dimensional digital filter. Y = FILTER(B,A,X) filters the data in vector X with the filter described by vectors A and B to create the filtered data Y. The filter is a "Direct Form II Transposed" implementation of the standard difference equation:

a(1)*y(n) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n-nb)

- a(2)*y(n-1) - ... - a(na+1)*y(n-na)

If a(1) is not equal to 1, FILTER normalizes the filter coefficients by a(1).

FILTER always operates along the first non-singleton dimension, namely dimension 1 for column vectors and non-trivial matrices, and dimension 2 for row vectors.

[Y,Zf] = FILTER(B,A,X,Zi) gives access to initial and final conditions, Zi and Zf, of the delays. Zi is a vector of length MAX(LENGTH(A),LENGTH(B))-1, or an array with the leading dimension of size MAX(LENGTH(A),LENGTH(B))-1 and with remaining dimensions matching those of X.

FILTER(B,A,X,[],DIM) or FILTER(B,A,X,Zi,DIM) operates along the dimension DIM. ---------------------------------------------------------------------------------------------------------------->> help zeros ZEROS Zeros array. ZEROS(N) is an N-by-N matrix of zeros.

ZEROS(M,N) or ZEROS([M,N]) is an M-by-N matrix of zeros.

ZEROS(M,N,P,...) or ZEROS([M N P ...]) is an M-by-N-by-P-by-... array of

zeros.

ZEROS(SIZE(A)) is the same size as A and all zeros. ZEROS with no arguments is the scalar 0. ZEROS(M,N,...,CLASSNAME) or ZEROS([M,N,...],CLASSNAME) is an M-by-N-by-... array of zeros of class CLASSNAME.

Note: The size inputs M, N, and P... should be nonnegative integers. Negative integers are treated as 0.

Example: x = zeros(2,3,'int8'); ---------------------------------------------------------------------------------------------------------------->> help diff DIFF Difference and approximate derivative. DIFF(X), for a vector X, is [X(2)-X(1) X(3)-X(2) ... X(n)-X(n-1)]. DIFF(X), for a matrix X, is the matrix of row differences, [X(2:n,:) - X(1:n-1,:)]. DIFF(X), for an N-D array X, is the difference along the first non-singleton dimension of X. DIFF(X,N) is the N-th order difference along the first non-singleton dimension (denote it by DIM). If N >= size(X,DIM), DIFF takes successive differences along the next non-singleton dimension. DIFF(X,N,DIM) is the Nth difference function along dimension DIM. If N >= size(X,DIM), DIFF returns an empty array.

Examples: h = .001; x = 0:h:pi; diff(sin(x.^2))/h is an approximation to 2*cos(x.^2).*x diff((1:10).^2) is 3:2:19

If X = [3 7 5 0 9 2] then diff(X,1,1) is [-3 2 -3], diff(X,1,2) is [4 -2 9 -7], diff(X,2,2) is the 2nd order difference along the dimension 2, and diff(X,3,2) is the empty matrix. ---------------------------------------------------------------------------------------------------------------->> help disp DISP Display array. DISP(X) displays the array, without printing the array name. In all other ways it's the same as leaving the semicolon off an expression except that empty arrays don't display. ---------------------------------------------------------------------------------------------------------------->> help plot PLOT Linear plot. PLOT(X,Y) plots vector Y versus vector X. If X or Y is a matrix, then the vector is plotted versus the rows or columns of the matrix, whichever line up. If X is a scalar and Y is a vector, disconnected line objects are created and plotted as discrete points vertically at X.

PLOT(Y) plots the columns of Y versus their index. If Y is complex, PLOT(Y) is equivalent to PLOT(real(Y),imag(Y)). In all other uses of PLOT, the imaginary part is ignored.

Various line types, plot symbols and colors may be obtained with PLOT(X,Y,S) where S is a character string made from one element from any or all the following 3 columns:

b g r c m y k w

blue green red cyan magenta yellow black white ^ < > p h

. o x +

point circle x-mark plus * s star

solid dotted

-. dashdot -- dashed (none) no line

square diamond triangle (down)

d v

triangle (up) triangle (left) triangle (right) pentagram hexagram

For example, PLOT(X,Y,'c+:') plots a cyan dotted line with a plus at each data point; PLOT(X,Y,'bd') plots blue diamond at each data

point but does not draw any line.

PLOT(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,...) combines the plots defined by the (X,Y,S) triples, where the X's and Y's are vectors or matrices and the S's are strings.

For example, PLOT(X,Y,'y-',X,Y,'go') plots the data twice, with a solid yellow line interpolating green circles at the data points.

The PLOT command, if no color is specified, makes automatic use of the colors specified by the axes ColorOrder property. The default ColorOrder is listed in the table above for color systems where the default is blue for one line, and for multiple lines, to cycle through the first six colors in the table. For monochrome systems, PLOT cycles over the axes LineStyleOrder property.

If you do not specify a marker type, PLOT uses no marker. If you do not specify a line style, PLOT uses a solid line.

PLOT(AX,...) plots into the axes with handle AX.

PLOT returns a column vector of handles to lineseries objects, one handle per plotted line.

The X,Y pairs, or X,Y,S triples, can be followed by

parameter/value pairs to specify additional properties of the lines. For example, PLOT(X,Y,'LineWidth',2,'Color',[.6 0 0]) will create a plot with a dark red line width of 2 points. ---------------------------------------------------------------------------------------------------------------->> help subplot SUBPLOT Create axes in tiled positions. H = SUBPLOT(m,n,p), or SUBPLOT(mnp), breaks the Figure window into an m-by-n matrix of small axes, selects the p-th axes for the current plot, and returns the axis handle. The axes are counted along the top row of the Figure window, then the second row, etc. For example,

SUBPLOT(2,1,1), PLOT(income) SUBPLOT(2,1,2), PLOT(outgo)

plots income on the top half of the window and outgo on the bottom half. If the CurrentAxes is nested in a uipanel the panel is used as the parent for the subplot instead of the current figure.

SUBPLOT(m,n,p), if the axis already exists, makes it current. SUBPLOT(m,n,p,'replace'), if the axis already exists, deletes it and creates a new axis. SUBPLOT(m,n,p,'align') places the axes so that the plot boxes are aligned, but does not prevent the labels and ticks from

overlapping. SUBPLOT(m,n,P), where P is a vector, specifies an axes position that covers all the subplot positions listed in P. SUBPLOT(H), where H is an axis handle, is another way of making an axis current for subsequent plotting commands.

SUBPLOT('position',[left bottom width height]) creates an axis at the specified position in normalized coordinates (in in the range from 0.0 to 1.0).

SUBPLOT(..., PROP1, VALUE1, PROP2, VALUE2, ...) sets the specified property-value pairs on the subplot axis. To add the subplot to a specific figure pass the figure handle as the value for the 'Parent' property.

If a SUBPLOT specification causes a new axis to overlap an existing axis, the existing axis is deleted - unless the position of the new and existing axis are identical. For example, the statement SUBPLOT(1,2,1) deletes all existing axes overlapping the left side of the Figure window and creates a new axis on that side - unless there is an axes there with a position that exactly matches the position of the new axes (and 'replace' was not specified), in which case all other overlapping axes will be deleted and the matching axes will become the current axes.

SUBPLOT(111) is an exception to the rules above, and is not identical in behavior to SUBPLOT(1,1,1). For reasons of backwards compatibility, it is a special case of subplot which does not immediately create an axes, but instead sets up the figure so that the next graphics command executes CLF RESET in the figure (deleting all children of the figure), and creates a new axes in the default position. This syntax does not return a handle, so it is an error to specify a return argument. The delayed CLF RESET is accomplished by setting the figure's NextPlot to 'replace'.

Be aware when creating subplots from scripts that the Position property of subplots is not finalized until either a drawnow command is issued, or MATLAB returns to await a user command. That is, the value obtained for subplot i by the command get(h(i),'Position') will not be correct until the script refreshes the plot or exits. ---------------------------------------------------------------------------------------------------------------->> help axis AXIS Control axis scaling and appearance. AXIS([XMIN XMAX YMIN YMAX]) sets scaling for the x- and y-axes on the current plot. AXIS([XMIN XMAX YMIN YMAX ZMIN ZMAX]) sets the scaling for the x-, y- and z-axes on the current 3-D plot. AXIS([XMIN XMAX YMIN YMAX ZMIN ZMAX CMIN CMAX]) sets the scaling for the x-, y-, z-axes and color scaling limits on

the current axis (see CAXIS). V = AXIS returns a row vector containing the scaling for the current plot. If the current view is 2-D, V has four components; if it is 3-D, V has six components.

AXIS AUTO returns the axis scaling to its default, automatic mode where, for each dimension, 'nice' limits are chosen based on the extents of all line, surface, patch, and image children. AXIS MANUAL freezes the scaling at the current limits, so that if HOLD is turned on, subsequent plots will use the same limits. AXIS TIGHT sets the axis limits to the range of the data. AXIS FILL sets the axis limits and PlotBoxAspectRatio so that the axis fills the position rectangle. This option only has an effect if PlotBoxAspectRatioMode or DataAspectRatioMode are manual.

AXIS IJ puts MATLAB into its "matrix" axes mode. The coordinate system origin is at the upper left corner. The i axis is vertical and is numbered from top to bottom. The j axis is horizontal and is numbered from left to right. AXIS XY puts MATLAB into its default "Cartesian" axes mode. The coordinate system origin is at the lower left corner. The x axis is horizontal and is numbered from left to right. The y axis is vertical and is numbered from bottom to top.

AXIS EQUAL sets the aspect ratio so that equal tick mark increments on the x-,y- and z-axis are equal in size. This makes SPHERE(25) look like a sphere, instead of an ellipsoid. AXIS IMAGE is the same as AXIS EQUAL except that the plot box fits tightly around the data. AXIS SQUARE makes the current axis box square in size. AXIS NORMAL restores the current axis box to full size and removes any restrictions on the scaling of the units. This undoes the effects of AXIS SQUARE and AXIS EQUAL. AXIS VIS3D freezes aspect ratio properties to enable rotation of 3-D objects and overrides stretch-to-fill.

AXIS OFF turns off all axis labeling, tick marks and background. AXIS ON turns axis labeling, tick marks and background back on.

AXIS(H,...) changes the axes handles listed in vector H. >> help grid GRID Grid lines. GRID ON adds major grid lines to the current axes. GRID OFF removes major and minor grid lines from the current axes. GRID MINOR toggles the minor grid lines of the current axes. GRID, by itself, toggles the major grid lines of the current axes. GRID(AX,...) uses axes AX instead of the current axes. GRID sets the XGrid, YGrid, and ZGrid properties of the current axes. set(AX,'XMinorGrid','on') turns on the minor grid.

Potrebbero piacerti anche