CELLFIRST Returns the first (or last) element of each entry in a cell array. Y=CELLFIRST(X), where X is a cell array of N numeric arrays, returns a length N array Y containing the first element of each of the N cells. An example of an input cell array X and the output Y is as follows: X{1} = [1 2 3]'; X{2} = [3 4]'; X{3} = [5 6 7 ]'; Y = [1 3 5]'; [Y1,Y2,...YN]=CELLFIRST(X1,X2,...XN) with multiple input arguments, all of the same size, also works. CELLFIRST(X1,X2,...XN); with no output arguments overwrites the original input variables. CELLFIRST(...,'last') optionally returns the last element in each cell. 'cellfirst --t' runs a test. Usage: y=cellfirst(x); [y1,y2]=cellfirst(x1,x2); [y1,y2]=cellfirst(x1,x2,'last'); __________________________________________________________________ This is part of JLAB --- type 'help jlab' for more information (C) 2015 J.M. Lilly --- type 'help jlab_license' for details