|
重名?
下面是我在matlab主页上找到的
Subject:
Why do I receive the error "Attempt to execute SCRIPT as a function" ?
Problem Description:
I receive the error:
??? Attempt to execute SCRIPT untitled as a function.
Solution:
This error results because there is a script M-file named <filename> and your calling syntax requires that this script either takes arguments or returns values, which are properties of a function and not of a script.
This can happen because there is a script <filename> and a function <filename> that both exist on the path. If the script appears before the function on the path, then your commands will attempt to use it instead of the function. You may use the command:
which <filename>
to determine which instance of <filename> that MATLAB is attempting to call. If you want to see all instances of a function on the path, type the command:
which <filename> -all
Alternatively, such behavior may occur in certain scenarios where your filename contains invalid characters. In particular, you may see this error if the filename contains characters that are MATLAB operators such as -, +, or *. M-file filenames must begin with a letter, which may be followed by any combination of letters, digits, and underscores. |
评分
-
1
查看全部评分
-
|