Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
24
Добавлен:
09.02.2015
Размер:
237.57 Кб
Скачать

It is false, displays the formatted string contained in errmsg. The errmsg

string can include escape sequences such as \t or \n as well as any of the C

language conversion specifiers supported by the SPRINTF function (e.g., %s

or %d). Additional arguments VALUE1, VALUE2, etc. provide values that

correspond to the format specifiers and are only required when the ERRMSG

string includes conversion specifiers.

MATLAB makes substitutions for escape sequences and conversion specifiers in

ERRMSG in the same way that it does for the SPRINTF function. Type HELP SPRINTF

for more information on escape sequences and format specifiers.

ASSERT(EXPRESSION, MSG_ID, ERRMSG, VALUE1, VALUE2, ...) evaluates EXPRESSION

and, if it is false, displays the formatted string ERRMSG as in the

paragraph above. This syntax also tags the error with the message identifier

contained in MSG_ID. A message identifier is a string of the form

<component>[:<component>]:<mnemonic>,

where <component> and <mnemonic> are alphanumeric strings (for example,

'MATLAB:AssertionFailed').

See also error, sprintf

Overloaded methods:

cgslparser/assert

Reference page in Help browser

doc assert

<rethrow> - Reissue error.

RETHROW Reissue error.

In order to avoid global state, it is better to use the MException

object in order to reissue errors. See help for MException/rethrow.

RETHROW(ERR) reissues an error as stored in the structure ERR. The

currently running M-file terminates and control is returned to the

keyboard, unless an enclosing CATCH block is present. ERR must be a

structure containing at least the following two fields:

message : the text of the error message

identifier : the message identifier of the error message

ERR can also contain the field 'stack', identical in format to the

output of the DBSTACK command. If the 'stack' field is present, MATLAB

sets the stack of the rethrown error to that value. Otherwise, the

stack is set to the line at which the rethrow occurs.

See help for ERROR for more information about error message

identifiers.

See also MException, MException/rethrow, error, try, catch.

Overloaded methods:

MException/rethrow

Reference page in Help browser

doc rethrow

Evaluation and execution.

<eval> - Execute string with MATLAB expression.

EVAL Execute string with MATLAB expression.

EVAL(s), where s is a string, causes MATLAB to execute

the string as an expression or statement.

[X,Y,Z,...] = EVAL(s) returns output arguments from the

expression in string s.

The input strings to EVAL are often created by

concatenating substrings and variables inside square

brackets. For example:

Generate a sequence of matrices named M1 through M12:

for n = 1:12

eval(['M' num2str(n) ' = magic(n)'])

end

Run a selected M-file script.

D = {'odedemo'; 'sunspots'; 'fitdemo'};

n = input('Select a demo number: ');

eval(D{n})

See also feval, evalin, assignin, evalc.

Overloaded methods:

opaque/eval

cgmathsobject/eval

cgfuncmodel/eval

cgexpr/eval

xregusermod/eval

xregunispline/eval

xregtwostage/eval

xregtransient/eval

xregstatsmodel/eval

xregrbf/eval

xregnullmodel/eval

xregnnet/eval

xregmulti/eval

xregmodel/eval

xreglolimot/eval

xreglinear/eval

xreghybridrbf/eval

xregexportmodel/eval

xregdynlolimot/eval

xregcubic/eval

xregcovariance/eval

xregarx/eval

xreg3xspline/eval

localusermod/eval

localtruncps/eval

localsurface/eval

localpspline/eval

localpoly/eval

localbspline/eval

localavfit/eval

classregtree/eval

sym/eval

Reference page in Help browser

doc eval

<evalc> - Evaluate MATLAB expression with capture.

EVALC Evaluate MATLAB expression with capture.

T = EVALC(S) is the same as EVAL(S) except that anything that would

normally be written to the command window, except for error messages,

is captured and returned in the character array T (lines in T are

separated by '\n' characters).

[T,X,Y,Z,...] = EVALC(S) is the same as [X,Y,Z,...] = EVAL(S) except

that any output is captured into T.

Note: While in evalc, DIARY, MORE and INPUT are disabled.

See also eval, evalin, diary, more, input.

Overloaded methods:

opaque/evalc

Reference page in Help browser

doc evalc

<feval> - Execute the specified function.

FEVAL Execute the specified function.

FEVAL(F,x1,...,xn) evaluates the function specified by a function

handle or function name, F, at the given arguments, x1,...,xn.

For example, if F = @foo, FEVAL(F,9.64) is the same as foo(9.64).

Соседние файлы в папке Библиотеки Matlab