Friday, July 24, 2009

Description Continued...

asinh

Inverse hyperbolic sine

Syntax

  • Y = asinh(X)

Description

Y = asinh(X) returns the inverse hyperbolic sine for each element of X.

The asinh function operates element-wise on arrays. The function's domains and ranges include complex values. All angles are in radians.

Examples

Graph the inverse hyperbolic sine function over the domain .

  • x = -5:.01:5;
    plot(x,asinh(x)), grid on

Definition

The hyperbolic inverse sine can be defined as

Algorithm

asinh uses FDLIBM, which was developed at SunSoft, a Sun Microsystems, Inc. business, by Kwok C. Ng, and others. For information about FDLIBM


assignin

Assign a value to a workspace variable

Syntax

  • assignin(ws,'var',val)

Description

assignin(ws,'var',val) assigns the value val to the variable var in the workspace ws. var is created if it doesn't exist. ws can have a value of 'base' or 'caller' to denote the MATLAB base workspace or the workspace of the caller function.

The assignin function is particularly useful for these tasks:

  • Exporting data from a function to the MATLAB workspace
  • Within a function, changing the value of a variable that is defined in the workspace of the caller function (such as a variable in the function argument list)

Remarks

The MATLAB base workspace is the workspace that is seen from the MATLAB command line (when not in the debugger). The caller workspace is the workspace of the function that called the M-file. Note the base and caller workspaces are equivalent in the context of an M-file that is invoked from the MATLAB command line.

Examples

This example creates a dialog box for the image display function, prompting a user for an image name and a colormap name. The assignin function is used to export the user-entered values to the MATLAB workspace variables imfile and cmap.

  • prompt = {'Enter image name:','Enter colormap name:'};
    title = 'Image display - assignin example';
    lines = 1;
    def = {'my_image','hsv'};
    answer = inputdlg(prompt,title,lines,def);
    assignin('base','imfile',answer{1});
    assignin('base','cmap',answer{2});

No comments:

Post a Comment