error 함수()
2670 단어 개인 학습
표시 행 및 중단 함수 내보내기
error Display message and abort function. error(MSGID, ERRMSG, V1, V2, …) displays a descriptive message ERRMSG when the currently-running program encounters an error condition. Depending on how the program code responds to the error, MATLAB then either enters a catch block to handle the error condition, or exits the program. MSGID is a unique message identifier string that MATLAB attaches to the
error message to better identify the source of the error (see MESSAGE
IDENTIFIERS, below).
ERRMSG is a character string that informs the user about the cause of
the error and can also suggest how to correct the faulty condition.
The ERRMSG string may include predefined escape sequences, such as
for newline, and conversion specifiers, such as %d for a decimal
number.
Inputs V1, V2, etc. represent values or substrings that are to
replace conversion specifiers used in the ERRMSG string. The format
is the same as that used with the SPRINTF function.
error(ERRMSG, V1, V2, ...) reports an error without including a
message identifier in the error report.
error(ERRMSG) is the same as the above syntax, except that the ERRMSG
string contains no conversion specifiers, no escape sequences, and no
substitution value (V1, V2, ...) arguments.
error(MSGSTRUCT) reports the error using fields stored in the scalar
structure MSGSTRUCT. This structure can contain these fields:
message - Error message string
identifier - See MESSAGE IDENTIFIERS, below
stack - Struct similar to the output of the DBSTACK function
If MSGSTRUCT is an empty structure, no action is taken and error
returns without exiting the program. If you do not specify the
stack, the error function determines it from the current file and line.
MESSAGE IDENTIFIERS
A message identifier is a string of the form
[component:]component:mnemonic
that enables MATLAB to identify with a specific error. The string
consists of one or more COMPONENT fields followed by a single
MNEMONIC field. All fields are separated by colons. Here is an
example identifier that has 2 components and 1 mnemonic.
'myToolbox:myFunction:fileNotFound'
The COMPONENT and MNEMONIC fields must begin with an
upper or lowercase letter which is then followed by alphanumeric
or underscore characters.
The COMPONENT field specifies a broad category under which
various errors can be generated. The MNEMONIC field is a string
normally used as a tag related to the particular message.
From the command line, you can obtain the message identifier for an
error that has been issued using the MException.last function.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
error 함수()
error Display message and abort function.
error(MSGID, ERRMSG, V1, V2, …) displays a descriptive message ERRMSG when the...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.
MSGID is a unique message identifier string that MATLAB attaches to the
error message to better identify the source of the error (see MESSAGE
IDENTIFIERS, below).
ERRMSG is a character string that informs the user about the cause of
the error and can also suggest how to correct the faulty condition.
The ERRMSG string may include predefined escape sequences, such as
for newline, and conversion specifiers, such as %d for a decimal
number.
Inputs V1, V2, etc. represent values or substrings that are to
replace conversion specifiers used in the ERRMSG string. The format
is the same as that used with the SPRINTF function.
error(ERRMSG, V1, V2, ...) reports an error without including a
message identifier in the error report.
error(ERRMSG) is the same as the above syntax, except that the ERRMSG
string contains no conversion specifiers, no escape sequences, and no
substitution value (V1, V2, ...) arguments.
error(MSGSTRUCT) reports the error using fields stored in the scalar
structure MSGSTRUCT. This structure can contain these fields:
message - Error message string
identifier - See MESSAGE IDENTIFIERS, below
stack - Struct similar to the output of the DBSTACK function
If MSGSTRUCT is an empty structure, no action is taken and error
returns without exiting the program. If you do not specify the
stack, the error function determines it from the current file and line.
MESSAGE IDENTIFIERS
A message identifier is a string of the form
[component:]component:mnemonic
that enables MATLAB to identify with a specific error. The string
consists of one or more COMPONENT fields followed by a single
MNEMONIC field. All fields are separated by colons. Here is an
example identifier that has 2 components and 1 mnemonic.
'myToolbox:myFunction:fileNotFound'
The COMPONENT and MNEMONIC fields must begin with an
upper or lowercase letter which is then followed by alphanumeric
or underscore characters.
The COMPONENT field specifies a broad category under which
various errors can be generated. The MNEMONIC field is a string
normally used as a tag related to the particular message.
From the command line, you can obtain the message identifier for an
error that has been issued using the MException.last function.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
error 함수()error Display message and abort function. error(MSGID, ERRMSG, V1, V2, …) displays a descriptive message ERRMSG when the...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.