cd v:\cursos\pos\otimiza\aulas help meshgrid MESHGRID X and Y arrays for 3-D plots. [X,Y] = MESHGRID(x,y) transforms the domain specified by vectors x and y into arrays X and Y that can be used for the evaluation of functions of two variables and 3-D surface plots. The rows of the output array X are copies of the vector x and the columns of the output array Y are copies of the vector y. [X,Y] = MESHGRID(x) is an abbreviation for [X,Y] = MESHGRID(x,x). [X,Y,Z] = MESHGRID(x,y,z) produces 3-D arrays that can be used to evaluate functions of three variables and 3-D volumetric plots. For example, to evaluate the function x*exp(-x^2-y^2) over the range -2 < x < 2, -2 < y < 2, [X,Y] = meshgrid(-2:.2:2, -2:.2:2); Z = X .* exp(-X.^2 - Y.^2); mesh(Z) MESHGRID is like NDGRID except that the order of the first two input and output arguments are switched (i.e., [X,Y,Z] = MESHGRID(x,y,z) produces the same result as [Y,X,Z] = NDGRID(y,x,z)). Because of this, MESHGRID is better suited to problems in cartesian space, while NDGRID is better suited to N-D problems that aren't spatially based. MESHGRID is also limited to 2-D or 3-D. See also SURF, SLICE, NDGRID. [X,Y] = meshgrid(-2:.2:2, -3:.2:3); size(X) ans = 31 21 X(1:5,1:5) ans = -2.0000 -1.8000 -1.6000 -1.4000 -1.2000 -2.0000 -1.8000 -1.6000 -1.4000 -1.2000 -2.0000 -1.8000 -1.6000 -1.4000 -1.2000 -2.0000 -1.8000 -1.6000 -1.4000 -1.2000 -2.0000 -1.8000 -1.6000 -1.4000 -1.2000 Y(1:5,1:5) ans = -3.0000 -3.0000 -3.0000 -3.0000 -3.0000 -2.8000 -2.8000 -2.8000 -2.8000 -2.8000 -2.6000 -2.6000 -2.6000 -2.6000 -2.6000 -2.4000 -2.4000 -2.4000 -2.4000 -2.4000 -2.2000 -2.2000 -2.2000 -2.2000 -2.2000 Z = X .* exp(-X.^2 - Y.^2); Z(1:5,1:5) ans = -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0001 -0.0001 -0.0000 -0.0001 -0.0001 -0.0002 -0.0003 -0.0001 -0.0002 -0.0004 -0.0006 -0.0009 -0.0003 -0.0006 -0.0010 -0.0016 -0.0022 help mesh MESH 3-D mesh surface. MESH(X,Y,Z,C) plots the colored parametric mesh defined by four matrix arguments. The view point is specified by VIEW. The axis labels are determined by the range of X, Y and Z, or by the current setting of AXIS. The color scaling is determined by the range of C, or by the current setting of CAXIS. The scaled color values are used as indices into the current COLORMAP. MESH(X,Y,Z) uses C = Z, so color is proportional to mesh height. MESH(x,y,Z) and MESH(x,y,Z,C), with two vector arguments replacing the first two matrix arguments, must have length(x) = n and length(y) = m where [m,n] = size(Z). In this case, the vertices of the mesh lines are the triples (x(j), y(i), Z(i,j)). Note that x corresponds to the columns of Z and y corresponds to the rows. MESH(Z) and MESH(Z,C) use x = 1:n and y = 1:m. In this case, the height, Z, is a single-valued function, defined over a geometrically rectangular grid. MESH(...,'PropertyName',PropertyValue,...) sets the value of the specified surface property. Multiple property values can be set with a single statement. MESH returns a handle to a SURFACE object. AXIS, CAXIS, COLORMAP, HOLD, SHADING, HIDDEN and VIEW set figure, axes, and surface properties which affect the display of the mesh. See also SURF, MESHC, MESHZ, WATERFALL. mesh(X,Y,Z) help countour countour.m not found. help countor countor.m not found. help contour CONTOUR Contour plot. CONTOUR(Z) is a contour plot of matrix Z treating the values in Z as heights above a plane. A contour plot are the level curves of Z for some values V. The values V are chosen automatically. CONTOUR(X,Y,Z) X and Y specify the (x,y) coordinates of the surface as for SURF. CONTOUR(Z,N) and CONTOUR(X,Y,Z,N) draw N contour lines, overriding the automatic value. CONTOUR(Z,V) and CONTOUR(X,Y,Z,V) draw LENGTH(V) contour lines at the values specified in vector V. Use CONTOUR(Z,[v v]) or CONTOUR(X,Y,Z,[v v]) to compute a single contour at the level v. [C,H] = CONTOUR(...) returns contour matrix C as described in CONTOURC and a column vector H of handles to LINE or PATCH objects, one handle per line. Both of these can be used as input to CLABEL. The UserData property of each object contains the height value for each contour. The contours are normally colored based on the current colormap and are drawn as PATCH objects. You can override this behavior with the syntax CONTOUR(...,'LINESPEC') to draw the contours as LINE objects with the color and linetype specified. Uses code by R. Pawlowicz to handle parametric surfaces and inline contour labels. Example: [c,h] = contour(peaks); clabel(c,h), colorbar See also CONTOUR3, CONTOURF, CLABEL, COLORBAR. contour(X,Y,Z) contour(X,Y,Z,50) mesh(X,Y,Z) contour(X,Y,Z,[0.25 0.25]) [c,h]=contour(X,Y,Z); clabel(c,h) 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, length(Y) disconnected points are plotted. 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 colunms: y yellow . point - solid m magenta o circle : dotted c cyan x x-mark -. dashdot r red + plus -- dashed g green * star b blue s square w white d diamond k black v triangle (down) ^ triangle (up) < triangle (left) > triangle (right) p pentagram h 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 yellow 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. PLOT returns a column vector of handles to LINE objects, one handle per line. The X,Y pairs, or X,Y,S triples, can be followed by parameter/value pairs to specify additional properties of the lines. See also SEMILOGX, SEMILOGY, LOGLOG, GRID, CLF, CLC, TITLE, XLABEL, YLABEL, AXIS, AXES, HOLD, COLORDEF, LEGEND, and SUBPLOT. dir t*.m test0.m test12.m test16.m test1m.m test22.m test5.m test9.m test1.m test13.m test17.m test2.m test23.m test6.m test10.m test14.m test18.m test20.m test3.m test7.m tes help lang Programming language constructs. Control flow. if - Conditionally execute statements. else - IF statement condition. elseif - IF statement condition. end - Terminate scope of FOR, WHILE, SWITCH, TRY and IF statements. for - Repeat statements a specific number of times. while - Repeat statements an indefinite number of times. break - Terminate execution of WHILE or FOR loop. switch - Switch among several cases based on expression. case - SWITCH statement case. otherwise - Default SWITCH statement case. try - Begin TRY block. catch - Begin CATCH block. return - Return to invoking function. Evaluation and execution. eval - Execute string with MATLAB expression. evalc - Evaluate MATLAB expression with capture. feval - Execute function specified by string. evalin - Evaluate expression in workspace. builtin - Execute built-in function from overloaded method. assignin - Assign variable in workspace. run - Run script. Scripts, functions, and variables. script - About MATLAB scripts and M-files. function - Add new function. global - Define global variable. persistent - Define persistent variable. mfilename - Name of currently executing M-file. lists - Comma separated lists. exist - Check if variables or functions are defined. isglobal - True for global variables. mlock - Prevent M-file from being cleared. munlock - Allow M-file to be cleared. mislocked - True if M-file cannot be cleared. precedence - Operator Precedence in MATLAB. Argument handling. nargchk - Validate number of input arguments. nargin - Number of function input arguments. nargout - Number of function output arguments. varargin - Variable length input argument list. varargout - Variable length output argument list. inputname - Input argument name. Message display. error - Display error message and abort function. warning - Display warning message. lasterr - Last error message. lastwarn - Last warning message. errortrap - Skip error during testing. disp - Display an array. display - Overloaded function to display an array. fprintf - Display formatted message. sprintf - Write formatted data to a string. Interactive input. input - Prompt for user input. keyboard - Invoke keyboard from M-file. pause - Wait for user response. uimenu - Create user interface menu. uicontrol - Create user interface control. cd v:\cursos\pos\otimiza\aulas quit