From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to retrieve the given column of the data of arbitrary size?
Date: Mon, 12 Nov 2012 12:37:15 +0000 (UTC)
Organization: GMO LLC
Lines: 5
Message-ID: <k7qqhr$jf7$>
References: <k7qprc$h2m$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1352723835 19943 (12 Nov 2012 12:37:15 GMT)
NNTP-Posting-Date: Mon, 12 Nov 2012 12:37:15 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2383542
Xref: comp.soft-sys.matlab:782594

> For instance, A is a 10x10x10x10 matrix, the 3rd column of the 2nd dimension of A is given by squeeze(A(:,3,:,:)). What if the size of A is arbitrary? A could be 10x10, 5x10x5, 10x10x5x5x10, ..., or anything else. How to write a function applicable to arbitray A?

Take a look at the function subsref. You'll need to build an appropriate input structure (S) with the right number of colons. It shouldn't be difficult, just fiddly. The documentation will point you in the right direction.