Friday, July 24, 2009

Description continued..

alphamap

Specify the figure alphamap (transparency)

Syntax

  • alphamap(alpha_map)
    alphamap('parameter')
    alphamap('parameter',length)
    alphamap('parameter',delta)
    alphamap(figure_handle,...)
    alpha_map = alphamap
    alpha_map = alphamap(figure_handle)
    alpha_map = alphamap('parameter')

Description

alphamap enables you to set or modify a figure's Alphamap property. Unless you specify a figure handle as the first argument, alphamap operates on the current figure.

alphamap(alpha_map) set the AlphaMap of the current figure to the specified m-by-1 array of alpha values.

alphamap('parameter') create a new or modify the current alphamap. You can specify the following parameters:

  • default - set the AlphaMap property to the figure's default alphamap
  • rampup - create a linear alphamap with increasing opacity (default length equals the current alphamap length)
  • rampdown - create a linear alphamap with decreasing opacity (default length equals the current alphamap length)
  • vup - create an alphamap that is opaque in the center and becomes more transparent linearly towards the beginning and end (default length equals the current alphamap length)
  • vdown - create an alphamap that is transparent in the center and becomes more opaque linearly towards the beginning and end (default length equals the current alphamap length)
  • increase - modify the alphamap making it more opaque (default delta is .1, which is added to the current values)
  • decrease - modify the alphamap making it more transparent (default delta is .1, which is subtracted from the current values)
  • spin - rotate the current alphamap (default delta is 1; note that delta must be an integer)

alphamap('parameter',length) creates a new alphamap with the length specified by length (used with parameters: rampup, rampdown, vup, vdown)

alphamap('parameter',delta) modifies the existing alphamap using the value specified by delta (used with parameters: increase, decrease, spin).

alphamap(figure_handle,...) performs the operation on the alphamap of the figure identified by figure_handle.

alpha_map = alphamap return the current alphamap.

alpha_map = alphamap(figure_handle) returns the current alphamap from the figure identified by figure_handle.

alpha_map = alphamap('parameter') retruns the alphamap modified by the parameter, but does not set the AlphaMap property.



angle

Phase angle

Syntax

  • P = angle(Z)

Description

P = angle(Z) returns the phase angles, in radians, for each element of complex array Z. The angles lie between .

For complex Z, the magnitude R and phase angle theta are given by

  • R = abs(Z)
    theta = angle(Z)

and the statement

  • Z = R.*exp(i*theta)

converts back to the original complex Z.

Examples

  • Z = [ 1 - 1i   2 + 1i   3 - 1i   4 + 1i
    1 + 2i 2 - 2i 3 + 2i 4 - 2i
    1 - 3i 2 + 3i 3 - 3i 4 + 3i
    1 + 4i 2 - 4i 3 + 4i 4 - 4i ]

    P = angle(Z)

    P =
    -0.7854 0.4636 -0.3218 0.2450
    1.1071 -0.7854 0.5880 -0.4636
    -1.2490 0.9828 -0.7854 0.6435
    1.3258 -1.1071 0.9273 -0.7854

Algorithm

The angle function can be expressed as angle(z) = imag(log(z)) = atan2(imag(z),real(z)).



ans

The most recent answer

Syntax

  • ans

Description

MATLAB creates the ans variable automatically when you specify no output argument.

Examples

The statement

  • 2+2

is the same as

  • ans = 2+2

any

Test for any nonzeros

Syntax

  • B = any(A)
    B = any(A,dim)

Description

B = any(A) tests whether any of the elements along various dimensions of an array are nonzero or logical true (1).

If A is a vector, any(A) returns logical true (1) if any of the elements of A are nonzero, and returns logical false (0) if all the elements are zero.

If A is a matrix, any(A) treats the columns of A as vectors, returning a row vector of 1s and 0s.

If A is a multidimensional array, any(A) treats the values along the first non-singleton dimension as vectors, returning a logical condition for each vector.

B = any(A,dim) tests along the dimension of A specified by scalar dim.

Examples

Given,

  • A = [0.53 0.67 0.01 0.38 0.07 0.42 0.69]

then B = (A <> returns logical true (1) only where A is less than one half:

  • 0   0   1   1   1   1   0

The any function reduces such a vector of logical conditions to a single condition. In this case, any(B) yields 1.

This makes any particularly useful in if statements,

  • if any(A < 0.5)
    do something
    end

where code is executed depending on a single condition, not a vector of possibly conflicting conditions.

Applying the any function twice to a matrix, as in any(any(A)), always reduces it to a scalar condition.

  • any(any(eye(3)))
    ans =
    1

area

Area fill of a two-dimensional plot

Syntax

  • area(Y)
    area(X,Y)
    area(...,ymin)
    area(...,'PropertyName',PropertyValue,...)
    h = area(...)

Description

An area plot displays elements in Y as one or more curves and fills the area beneath each curve. When Y is a matrix, the curves are stacked showing the relative contribution of each row element to the total height of the curve at each x interval.

area(Y) plots the vector Y or the sum of each column in matrix Y. The x-axis automatically scales depending on length(Y) when Y is a vector and on size(Y,1)when Y is a matrix.

area(X,Y) plots Y at the corresponding values of X. If X is a vector, length(X) must equal length(Y) and X must be monotonic. If X is a matrix, size(X) must equal size(Y) and each column in X must be monotonic. To make a vector or matrix monotonic, use sort.

area(...,ymin) specifies the lower limit in the y direction for the area fill. The default ymin is 0.

area(...,'PropertyName',PropertyValue,...) specifies property name and property value pairs for the patch graphics object created by area.

h = area(...) returns handles of patch graphics objects. area creates one patch object per column in Y.

Remarks

area creates one curve from all elements in a vector or one curve per column in a matrix. The colors of the curves are selected from equally spaced intervals throughout the entire range of the colormap.

Examples

Plot the values in Y as a stacked area plot.

  • Y = [   1, 5, 3;
    3, 2, 7;
    1, 5, 3;
    2, 6, 1];
    area(Y)
    grid on
    colormap summer
    set(gca,'Layer','top')
    title 'Stacked Area Plot'




No comments:

Post a Comment