end

March 6th, 2008 Posted in Controls

Terminate scope of FOR, WHILE, SWITCH, TRY, and IF . Without ’s, FOR, WHILE, SWITCH, TRY, and IF wait for further input. Each is paired with the closest previous unpaired FOR, WHILE, SWITCH, TRY or IF and serves to terminate its scope.

end can also serve as the last index in an indexing expression. In that context, end = SIZE(X,k) when used as part of the k-th index. of this use are, X(3:end) and X(1,1:2:end-1). When using END to grow an , as in X(end+1) = 5, make sure X exists first.

end(A,K,N) is called for indexing involving the object A when end is part of the K-th index out of N indices. For example, the expression A(end-1,:) calls A’s end method with end(A,1,2).

See also for, while, switch, try, if.
Overloaded methods
help serial/end.m

Leave a Reply

You must be logged in to post a comment.