Friday, July 24, 2009

Matlab Functions Continued..

addpath

Add directories to MATLAB search path

Graphical Interface

As an alternative to the addpath function, use the Set Path dialog box. To open it, select Set Path from the File menu in the MATLAB desktop.

Syntax

  • addpath('directory')
    addpath('dir','dir2','dir3' ...)
    addpath('dir','dir2','dir3' ...'-flag')
    addpath dir1 dir2 dir3 ... -flag

Description

addpath('directory') prepends the specified directory to the current MATLAB search path, that is, it adds them to the top of the path. Use the full pathname for directory.

addpath('dir','dir2','dir3' ...) prepends all the specified directories to the path. Use the full pathname for each dir.

addpath('dir','dir2','dir3' ...'-flag') either prepends or appends the specified directories to the path depending on the value of flag.


flag Argument
Result
0 or begin
Prepend specified directories
1 or end
Append specified directories (add to bottom/end)

addpath dir1 dir2 dir3 ... -flag is the unquoted form of the syntax.

Examples

For the current path, viewed by typing path,

  • MATLABPATH
    c:\matlab\toolbox\general
    c:\matlab\toolbox\ops
    c:\matlab\toolbox\strfun

you can add c:/matlab/mymfiles to the front of the path by typing

  • addpath('c:/matlab/mymfiles')

Verify that the files were added to the path by typing

  • path

and MATLAB returns

  • MATLABPATH
    c:\matlab\mymfiles
    c:\matlab\toolbox\general
    c:\matlab\toolbox\ops
    c:\matlab\toolbox\strfun


addproperty (COM)

Add custom property to COM object

Syntax

  • addproperty(h, 'propertyname')

Arguments

h
Handle for a COM object previously returned from actxcontrol, actxserver, get, or invoke.

propertyname
A string specifying the name of the custom property to add to the object or interface.

Description

Add a custom property, propertyname, to the object or interface, h. You can assign a value to that property using set.

Examples

Create an mwsamp control and add a new property named Position to it. Assign an array value to the property:

  • f = figure('pos', [100 200 200 200]);
    h = actxcontrol('mwsamp.mwsampctrl.2', [0 0 200 200], f);
    get(h)
    Label: 'Label'
    Radius: 20

    addproperty(h, 'Position');
    set(h, 'Position', [200 120]);
    get(h)
    Label: 'Label'
    Radius: 20
    Position: [200 120]

    get(h, 'Position')
    ans =
    200 120


airy

Airy functions

Syntax

  • W = airy(Z)
    W = airy(k,Z)
    [W,ierr] = airy(k,Z)

Definition

The Airy functions form a pair of linearly independent solutions to

The relationship between the Airy and modified Bessel functions is

where

Description

W = airy(Z) returns the Airy function, , for each element of the complex array Z.

W = airy(k,Z) returns different results depending on the value of k.


k
Returns
0
The same result as airy(Z)
1
The derivative,
2
The Airy function of the second kind,
3
The derivative,

[W,ierr] = airy(k,Z) also returns completion flags in an array the same size as W.


ierr
Description
0
airy succesfully computed the Airy function for this element.
1
Illegal arguments
2
Overflow. Returns Inf
3
Some loss of accuracy in argument reduction
4
Unacceptable loss of accuracy, Z too large
5
No convergence. Returns NaN

No comments:

Post a Comment