The Role of Scope, Precedence, and Overloading When Creating a Function Handle
At the time you create a function handle, MATLAB must decide exactly which function it is to associate the handle to. In doing so, MATLAB uses the same rules used to determine which file to invoke when you make a function call. To make this determination, MATLAB considers the following:
Scope — The function named must be on the MATLAB path at the time the handle is constructed.
Precedence — MATLAB selects which function(s) to associate the handle with, according to the function precedence rules described under Determining Which Function Gets Called.
Overloading — If additional files on the path overload the function for any of the fundamental MATLAB classes, such as double or char, then MATLAB associates the handle with these files, as well.
Program files that overload a function for classes other than the standard MATLAB classes are not associated with the function handle at the time it is constructed. Function handles do operate on these types of overloaded functions, but MATLAB determines which implementation to call at the time of evaluation in this case.
The Role of Scope, Precedence, and Overloading When Creating a Function Handle
At the time you create a function handle, MATLAB must decide exactly which function it is to associate the handle to. In doing so, MATLAB uses the same rules used to determine which file to invoke when you make a function call. To make this determination, MATLAB considers the following:
Scope — The function named must be on the MATLAB path at the time the handle is constructed.
Precedence — MATLAB selects which function(s) to associate the handle with, according to the function precedence rules described under Determining Which Function Gets Called.
Overloading — If additional files on the path overload the function for any of the fundamental MATLAB classes, such as double or char, then MATLAB associates the handle with these files, as well.
Program files that overload a function for classes other than the standard MATLAB classes are not associated with the function handle at the time it is constructed. Function handles do operate on these types of overloaded functions, but MATLAB determines which implementation to call at the time of evaluation in this case.
การแปล กรุณารอสักครู่..
