Functions | |
!function | f ()%!assert(nargin |
!function | !assert (nargout, 0) |
!function | f (x, y)%!assert(nargin |
!test | !f (1) |
!assert (nargout, 1) | |
!test | !assert (f(), 2) |
!test | !assert (f(1), 1) |
!assert (nargout, 2) | |
!assert ([s t],[1 2]) | |
!assert (nargout, 4) | |
!function | f (x=0)%!assert(x |
!function!test | !f ()%!function f(x |
!assert (isa(x,"function_handle")&&strcmp(fname,"sin")) | |
!assert (isa(x,"function_handle")&&strcmp(ftype,"anonymous")) | |
Variables | |
!test | !f |
!function [x, y] | |
!x = 2 | |
!y = b | |
!test [s, t] = f (1, 2, 3, 4) | |
!fname = finfo.function | |
!ftype = finfo.type |
!assert | ( | isa(x,"function_handle")&&strcmp(ftype,"anonymous") | ) |
!assert | ( | isa(x,"function_handle")&&strcmp(fname,"sin") | ) |
!assert | ( | nargout | , | |
4 | ||||
) |
!assert | ( | ) |
!assert | ( | nargout | , | |
2 | ||||
) |
!test !assert | ( | f(1) | , | |
1 | ||||
) |
!test !assert | ( | f() | , | |
2 | ||||
) |
!assert | ( | nargout | , | |
1 | ||||
) |
!function !assert | ( | nargout | , | |
0 | ||||
) |
!function !test !f | ( | ) |
!test !f | ( | 1 | ) |
!function f | ( | x | = 0 |
) |
!function f | ( | x | , | |
y | ||||
) |
!function f | ( | ) |
!test !f |
!ftype = finfo.type |
!test[s, t, u, v] = f (1, 2, 3, 4) |
!x = 2 |
!y = b |