建议:此类问题多看help
matlab function:The MATLAB Fcn block applies the specified MATLAB function or expression to the input. The output of the function must match the output dimensions of the block or an error occurs.
fun:
The Fcn block applies the specified C language style expression to its input. The expression can be made up of one or more of these components: u -- The input to the block. If u is a vector, u(i) represents the ith element of the vector; u(1) or u alone represents the first element. Numeric constants Arithmetic operators (+ - * /^) Relational operators (== != > < >= <=) -- The expression returns 1 if the relation is true; otherwise, it returns 0. Logical operators (&& || !) -- The expression returns 1 if the relation is true; otherwise, it returns 0. Parentheses Mathematical functions -- abs, acos, asin, atan, atan2, ceil, cos, cosh, exp, fabs, floor, hypot, ln, log, log10, pow, power, rem, sgn, sin, sinh, sqrt, tan, and tanh. Workspace variables -- Variable names that are not recognized in the preceding list of items are passed to MATLAB for evaluation. Matrix or vector elements must be specifically referenced (e.g., A(1,1) instead of A for the first element in the matrix).
fun也就是用自定义的函数或者说是表达市进行计算
而matlab function是用matlab现有的函数进行计算。而你用的mod是没有在fun允许的符号范围内的。 |