<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<font face="Courier New">Dear All,<br>
<br>
I have an N-D array A (sometimes called hyperarray) with n
dimensions, where n is a parameter a priori unknown since it is,
for instance, an input argument of a function. So in conceptual
form each element is<br>
<br>
A(k1, k2, k3, ..., kn)<br>
<br>
I'm looking for an elegant way to extract all elements with a
given index over a given dimension, for instance<br>
<br>
A(:, k2, :, ..., :)<br>
<br>
This would mean to get an hyperarray made up of the k2-th column
of all remaining dimensions.<br>
<br>
If extraction could be performed replacing the indexes by a list,
for instance<br>
<br>
L = list(),<br>
for i=1:n<br>
L($+1) = 1:size(A)(i);<br>
end <br>
L(2) = 1<br>
<br>
Then A(L) would work, but the result is an error message "Invalid
index".<br>
<br>
The only way a list is accepted as multidimensional index is that
all except the first member are 1.<br>
<br>
Thanks,<br>
<br>
Federico Miyara <br>
</font>
</body>
</html>