• end

    Matlab TutorialsNo Comments

    default thumbnail

    Terminate scope of , , SWITCH, TRY, and IF . Without END’s, , WHILE, SWITCH, TRY, and IF wait further input. Each end is paired with the closest previous unpaired , 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 = (X,k) when used as part of the k-th index. Examples 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 expressions involving the object A when end is part of the K-th index out of N indices. For , the expression A(end-1,:) calls A’s end with end(A,1,2).

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

    You might also be interested in :  return

    Comment closed!