An "indexing way" to get the triangle (simplex in 2D) lying in the origin of A could be
N = size(A,1);
X = mod(0:numel(A)-1,N)+1;
Y = ceil((1:numel(A))/N);
V = A(X+Y-2 <= N-1);
It basically uses the index i of A, with , and calculates the indices in each dimension: , . This lead me to an alternative version, directly generating the indices:
N = size(A,1);
M = ndims(A); %M=2 for 2D
X = repmat(repelem(1:N,N^0),1,N^(M-1)); %123123123
Y = repmat(repelem(1:N,N^1),1,N^(M-2)); %111222333
V = A(X+Y-2 <= N-1);
Or with IND2SUB for any dimension (thanks to the accepted answer of this question):
N = size(A,1);
M = ndims(A); %m=2 for 2D
X = cell(1,M);
[X{:}] = ind2sub(repelem(N,M),1:numel(A));
V = A(sum(vertcat(X{:}))-M <= N-1);