|
Contents | Previous | Next | Subchapters |
| Syntax |
arg(value)
|
| See Also | arguments , nargin , nargout |
arg(0)
is equal to the number of arguments in a function reference.
If you enter
clear
function f(a, b, c, d, e) begin
print arg(0)
end
f(2, 4, 6)
O-Matrix will respond
3
arg(1)
is equal to the first argument of the function,
arg(2) is equal to the second argument, and so on.
If you enter
clear
function maximum() begin
imax = 1
for i = 2 to arg(0) begin
if arg(i) > arg(imax) then imax = i
end
return arg(imax)
end
maximum(1., 5, 2., 6)
O-Matrix will respond
6
clear
function f() begin
arg(2) = 3
end
x = 5
y = 6
f(x, y)
print x, y
O-Matrix will respond
5 3