Saturday, July 25, 2009

continued...

clabel

Contour plot elevation labels

Syntax

*

clabel(C,h)
clabel(C,h,v)
clabel(C,h,'manual')

clabel(C)
clabel(C,v)
clabel(C,'manual')

Description

The clabel function adds height labels to a two-dimensional contour plot.

clabel(C,h) rotates the labels and inserts them in the contour lines. The function inserts only those labels that fit within the contour, depending on the size of the contour.

clabel(C,h,v) creates labels only for those contour levels given in vector v, then rotates the labels and inserts them in the contour lines.

clabel(C,h,'manual') places contour labels at locations you select with a mouse. Press the left mouse button (the mouse button on a single-button mouse) or the space bar to label a contour at the closest location beneath the center of the cursor. Press the Return key while the cursor is within the figure window to terminate labeling. The labels are rotated and inserted in the contour lines.

clabel(C) adds labels to the current contour plot using the contour structure C output from contour. The function labels all contours displayed and randomly selects label positions.

clabel(C,v) labels only those contour levels given in vector v.

clabel(C,'manual') places contour labels at locations you select with a mouse.

Remarks

When the syntax includes the argument h, this function rotates the labels and inserts them in the contour lines (see Example). Otherwise, the labels are displayed upright and a '+' indicates which contour line the label is annotating.

Examples

Generate, draw, and label a simple contour plot.

*

[x,y] = meshgrid(-2:.2:2);
z = x.^exp(-x.^2-y.^2);
[C,h] = contour(x,y,z);
clabel(C,h);

class

Create object or return class of object

Syntax

*

str = class(object)
obj = class(s,'class_name')
obj = class(s,'class_name',parent1,parent2...)
obj = class(struct([]),'class_name',parent1,parent2...)

Description

str = class(object) returns a string specifying the class of object.

The following table lists the object class names that may be returned. All except the last one are MATLAB classes.

logical
Logical array of true and false values
char
Characters array
int8
8-bit signed integer array
uint8
8-bit unsigned integer array
int16
16-bit signed integer array
uint16
16-bit unsigned integer array
int32
32-bit signed integer array
uint32
32-bit unsigned integer array
int64
64-bit signed integer array
uint64
64-bit unsigned integer array
single
Single-precision floating point number array
double
Double-precision floating point number array
cell
Cell array
struct
Structure array
function handle
Array of values for calling functions indirectly
'class_name'
Custom MATLAB object class or Java class

obj = class(s,'class_name') creates an object of MATLAB class 'class_name' using structure s as a template. This syntax is valid only in a function named class_name.m in a directory named @class_name (where 'class_name' is the same as the string passed into class).

obj = class(s,'class_name',parent1,parent2,...) creates an object of MATLAB class 'class_name' that inherits the methods and fields of the parent objects parent1, parent2, and so on. Structure s is used as a template for the object.

obj = class(struct([]),'class_name',parent1,parent2,...) creates an object of MATLAB class 'class_name' that inherits the methods and fields of the parent objects parent1, parent2, and so on. Specifying the empty structure, struct([]), as the first argument ensures that the object created contains no fields other than those that are inherited from the parent objects.

Examples

To return in nameStr the name of the class of Java object j

*

nameStr = class(j)

To create a user-defined MATLAB object of class polynom

*

p = class(p,'polynom')

No comments:

Post a Comment